Monte Carlo calculation of hadron masses with light dynamical quarks