Yes. Dropping the bombs forced Japan to surrender quickly, ending the war and sparing far more lives than a ground invasion would have.