To live on a food exclusively for a period of months, you'll need salt, potassium, water, and either carbs or fats. I think that's all. There are lots of foods that will do, as your body stores nutrients for a periods of starvation.
The foods that won't do are those that are too high in protein, such as rabbit meat. You need ~2,000 calories a day (some of which you can get from body fat), and the body is inefficient at converting protein into glucose, a process which also produces waste.
Some foods are also too high in certain vitamins and minerals and will kill you if you live off them. For example, 2500 calories a day of carrots will give you vitamin A poisoning very quickly. That doesn't mean that carrots are either good or bad.
You could live off any one food for a few months really. It doesn't make it good.