Body weight, like so many of our individual characteristics, is the combined result of the genes we’re born with and the way we live our lives — how much and what we eat, and whether we exercise. The question is, how much does one influence the other?

Qibin Qi of the Harvard School of Public Health and his colleagues say that walking for about an hour a day can reduce the weight-promoting effect of certain genes by 50%. What’s more, the scientists say, sedentary activities like watching TV can trigger the weight-gaining effect of the same genes.

The study involved more than 12,000 men and women enrolled in the long-running Nurses’ Health Study and Health Professionals Follow-Up Study, which track lifestyle behaviors and health outcomes among doctors and nurses and other health care professionals. In order to determine how much influence the weight-gaining genes had on the participants’ weight, Qi and his colleagues focused on 32 genes that have previously been linked to body mass index (BMI), a ratio of height and weight that is used to determine overweight and obesity.

The researchers plotted the participants’ BMI against their so-called weight-gene score, a measure of how many variants of the 32 genes they possessed. Because we obtain one copy each of every gene from our mother and father, the maximum number of weight-promoting variants a subject could have was 64, and the minimum was zero. It turned out that no one was burdened with two copies of every BMI-increasing gene; the maximum number of variants in the study subjects totaled 43, while the minimum number of variants was 10. Based on this comparison, the researchers determined that for every genetic variant, the effect on BMI was to increase it by 0.13 kg/m2.

But among those who walked briskly for about an hour a day, this genetic effect was reduced by 50%, to 0.06 kg/m2. It’s the first study to bring the effect of exercise down to the genetic level, and to measure how physical activity can change the way genes work — in this case by inhibiting the activity of genes that promote weight gain.

The study also documented an increase in the activity of these genes among those who were more sedentary. For every two hours spent in front of the television every day, there was a 0.3 kg/m2 increase in BMI.

The fact that walking and TV watching each had independent effects on BMI hints that it’s important both to increase exercise and reduce sedentary time in order to lose weight. In other words, it’s not enough to be physically active most of the day if you’re still sitting on the couch watching TV for several hours. “We suggest that both increasing physical activity and reducing sedentary behavior can lower the genetic predisposition to obesity,” says Qi.

The authors acknowledge that it may not be the act of TV watching itself that enhances the activity of the weight-promoting genes. It may be that people who watch more TV also tend to eat more and exercise less, for example. But the latest findings provide some hope that even if you’re not blessed with lean genes — and not many of us are — you can modify the fattening effect of your DNA by changing how you live your life.