When determining units, I find it easiest to "divide the units" the same way you divided the numbers. Let me explain...
1) Ignore the numbers when determining units (they get in the way and can be confusing!). We have (m/s) ÷ m. The m's cancel, and we are left with 1/s.
2) Again, ignore the numbers! Recall a Joule is J = kg * m2 / s2. So, we have:
J ÷ ( m / s )2 = J ÷ (m2 / s2) = (kg * m2 / s2) ÷ (m2 / s2) = kg.
Hope this helps with calculating units in the future!