As long as these sweets are not eaten in excess, they won't get fat at all, which is very good for your health. So as long as you control the intake of high-sugar foods, even if there are other kinds of sugar in other foods, it will not cause you to gain weight!
However, if you lose weight, you still have to exercise more on your own.