I am not a nutritionist but I used to work for a health magazine and was always finding stories about the benefits of chocolate. It has antioxidant properties and is wonderful for coughs and sore throats. Just sniffing chocolate is supposed to boost the immune system. So I would say that jelly beans with their high sugar content and colourings would be worse. Stick to high cocoa content chocolate and it is actually good for you!
Chocolate is better for you there is less sugar and chocolate takes longer to digest than jelly sweets but haribo have now like frutella have reduced sugar!