Yes, you can, but you must be careful as to where you allow the ball to come into contact with your body in that area. Playing the ball on the front, back and top of the shoulder are usually not a problem. It is when you play a ball on the "outside" of the shoulder that you may have difficulties. A ball played on the outside of the shoulder might be seen as being played on the upper arm, and the arms and hands cannot be used to fairly play a ball. It will be the referee, or possibly his assistant, who will have to decide if a violation of the Laws of the Game has occurred. Note that if the arm is pressed to the body of the player, it might be easier for the official to determine that there was no intent to play the ball with the arm, and the play may be not be seen as a hand ball. But the referee will be the final authority in this issue.