Search for B(s) and B to dimuon decays in pp collisions at 7 TeV