Whether for weight loss, sport, recreation, comradery or charity, everyone is running a marathon these days. Unfortunately, marathoning and running in general comes with an inherent risk of muscle cramps, especially if you’re a newbie. The faster or farther you run, the more your risk increases.

Cramping tends to arise when a muscle suddenly tightens up or contracts and manifests as a sharp, stabbing pain. For runners, the muscles of the abdomen and legs are especially susceptible. Remarkably, consuming certain foods prior to or during a run may delay or even prevent onset of muscle cramps.

Related Article: Fueling Your Run: What to Eat Before a Race

As an exercise physiologist, nutritionist and avid distance runner with nearly 20 years in the game, I can personally attest that taking in the right foods at the right times can make all the difference between a comfortable and uncomfortable running experience. Here are five that are among the most beneficial and convenient.

1. Bananas

You can prevent muscle cramps before they start by eating a small banana at least 1-2 hours before a run. What makes bananas especially beneficial is their high potassium content. A continuous supply of potassium is needed to sustain the repeated muscle contractions required for running.

Potassium is an electrolyte so large quantities are lost in sweat, which generally increases the likelihood of muscle cramping and associated discomforts. This is one of the reasons why potassium-rich beverages like Gatorade are readily available for runners to consume during marathon races.

2. Greek Yogurt

Greek yogurt is an excellent source of potassium and calcium, both of which are essential for runners. Calcium plays a particularly key role in regulating the contraction as well as the relaxation of muscle. Interestingly, deficiencies and imbalances in calcium alone can lead to the onset of muscle cramps.

In addition to potassium and calcium, Greek yogurt is exceptionally rich in protein making it particularly beneficial for speeding muscle recovery after runs. To alleviate muscle cramping and enhance recovery, you can consume a single serving before and even after a run.

RECIPE: A Deliciously Creamy Spinach and Strawberry Yogurt Smoothie

3. Pumpkin Seeds

Pumpkin seeds are naturally a great source of magnesium, a key electrolyte mineral that works with calcium in controlling muscle contraction and relaxation. Magnesium specifically enables the delivery of oxygen to contracting muscles. Like other electrolytes, magnesium is naturally lost in sweat, which increases the likelihood of associated muscle cramping mainly due to an inadequate oxygen supply.

To stop this from happening, simply pop a handful of pumpkin seeds as a pre-running snack. And for maximum protection, opt for lightly salted versions. Believe it or not, low-sodium levels can increase the risk for developing muscle cramps, particularly among runners who cover distances of 10 miles or more. Since sodium is another electrolyte that’s lost in sweat, it’s just better to be safe than sorry.

4. Coconut Water

Muscle cramping can occur as a result of dehydration, which is essentially caused by inadequate consumption of fluids. In addition to supporting sustained hydration, coconut water houses a healthy balance of electrolyte minerals (potassium, magnesium and sodium) that greatly aid in the prevention of muscle cramps.

Coconut water also contains a good amount of l-arginine, an amino acid that enhances oxygen delivery to exercising muscles helping to further minimize the occurrence of cramping. You can freely indulge in the rich, refreshing taste of this fruity beverage before, during and after your runs as it is naturally low in calories.

5. Whole Eggs

If you’ve been avoiding whole eggs due to the yolks, you’ve been missing out on some good runner’s fuel! Moreover, you may be increasing your overall susceptibility to muscle cramps. While the whites of eggs are a great source of high-quality protein, the yolks are a good natural food source of vitamin D, which is essential for proper absorption of electrolytes like calcium and magnesium.

Low levels of vitamin D can lead to muscle cramps and general fatigue during a run. While the amount of vitamin D in yolks is relatively small, eggs are extremely versatile and easy to include in your diet. In addition to minimizing cramping and fatigue, eating whole eggs helps to reduce running-induced muscle damage and can also aid in running recovery.

Related Article: Five Highly Effective Ways to Prevent Running-Related Injuries

If you’re one who regularly experiences muscle cramps during running or any other form of exercise, consuming these foods can definitely help. In addition to eating the right kinds of foods, it’s also important to maintain adequate flexibility through daily stretching, as this is especially beneficial for easing the muscle tightness and tension associated with cramping.