If you think your genes are the reason you can't fit into your jeans, you should probably think again. Some people do have a genetic tendency to gain weight, but a new study found that this also means they stand to benefit the most from improving their diets.

Obesity is the end result of genetic, dietary and environmental influences. Your genes do not operate independently of your diet. For example, certain food additives can trigger metabolic problems that make it easier for a person to gain weight. Similarly, living near or commuting past fast food restaurants and drinking sugary beverages can set us up to become obese.

People who followed the AHEI-2010 and DASH diets lost weight and had a lower BMI. These reductions were even more pronounced among people with a high genetic risk for obesity.

Researchers from Tulane and Harvard Universities looked at the diets of over 14,000 US health professionals, using data from two large studies. A person's genetic risk score was determined based on 77 gene variants linked to body mass index (BMI), and their BMI and weight were examined every four years for 20 years, along with their eating habits.

Each person's diet was evaluated using three dietary scoring systems: the Alternate Healthy Eating Index 2010 (AHEI-2010), Dietary Approaches to Stop Hypertension (DASH) and the Alternate Mediterranean Diet (AMED). All are diets low in salt, sugary beverages, alcohol, red and processed meats, and high in fruits, vegetables, nuts and whole grains.

People who followed the AHEI-2010 and DASH diets lost weight and had a lower BMI. These reductions were even more pronounced among people with a high genetic risk for obesity. There wasn’t a clear finding for the AMED diet.

The findings mean that the benefits of eating a healthy diet to prevent weight gain are especially significant in people who are genetically predisposed to become obese.

Healthy eating is a challenge for many people — regardless of genetic influences on their weight, but basic good nutrition principles are universal. Eat more fruit and vegetables, more whole grains and more nuts. Eat moderate amounts of lean protein. Eat red and processed meats only occasionally. Avoid or reduce the use of salt, sugar and alcohol. Choose fresh foods over processed foods.

The study is published in The BMJ.