It’s good to exercise them, but not strenuously. Exercising an injured muscle increases blood flow to it and helps it heal. However, putting too much strain on the damaged tissue can aggravate it. I would go to the gym, but skip the weight class. You want light exercise of the sore muscles, something like cycling at low resistance for the legs. For the arms, try using those rubber tubing exercise bands. I’m sure there are trainers at your gym. Ask one of them for advice on how much you can do.