Yes, you can plant the ones that started growing in the pantry. Any of them that are marble to gumball size will have at least one eye and energy to grow. To make them easier to handle by planting time, it’s a good idea to separate them and trim them.
Ideally, keep the shoots trimmed to about 4-6 inches long. One way to do this if you have the room is to get boxes for cases of bottles from a liquor store and put the potatoes individually in each divided section. If you are going to close them up and stack them, cut/poke holes in the sides so they can breathe and not get moldy.
...I learned this nifty trick AFTER I tried planting potatoes that grew way too long in the pantry one year
Subject: Applestar's 2016 Garden
Now, we've talked about how you should really get certified seed potatoes to plant rather than using the grocery store potatoes.... So, I don't recommend doing what I'm doing, but when *someone* has shoved a bag of potatoes to the back of the pantry until THIS is going on by the time I discover them, what is a gardener to do? The extra long ones are actually tiniest tubers from last year's harvest that I meant to save more carefully for this year's seed.
...more in that thread if you want to see how I planted them and and how that turned out.