Solar particle acceleration by slow magnetosonic waves