Who invented the m and candy?

There's a bit of confusion in your question! It seems you're asking about two things:

* M&Ms: These were invented by Forrest Mars Sr. in 1941. He got the idea while visiting Spain during the Spanish Civil War and saw soldiers eating chocolate-coated candies.

* Candy in general: Candy has been around for centuries! The earliest forms of candy were likely made from honey and fruits, but it's hard to pinpoint a single inventor. Different cultures have developed their own unique candies throughout history.