Both cherry and plum are part of the Prunus family (fruit which has a stone) which are not safe to give to pets as the wood is toxic. As the prunus family contain cyanogenic glycosides in their branches which when a hamster/or pets chew on the branches this chemical reacts with enzyme forming hydrogen cyanide. (More info here
https://extension.umd.edu/learn/toxi...prunus-species)
Here a list of safe and unsafe wood -
What wood to use?
All safe branches for hamsters that have been collected from outside need to be sanitised before giving them to your hamster plus you need to be certain that no pesticides/or chemical have been sprayed on them whilst in your garden.