You need to actually combine two different equations from which you can cancel out the mass of the object.