What I've heard is that any kind of whole grain contains some oil and can therefore go rancid if stored improperly or for a long time. (Refined ones are supposed to keep longer.) I store mine in the fridge or freezer.
Brown rice will go bad before white rice, but beans stored properly should last a lifetime. Wheat stored properly can last a lifetime, too. I read that some scientists found wheat berries in the tomb of a pharoh (sp?) and they were actually still good!! But, the thing to remember is STORED PROPERLY!!