Even people whose genes make them prone to obesity can keep the disease in check by jogging, walking or climbing mountains, according to research on more than 18,000 residents of Taiwan. But swimming and cycling might not be so successful at mitigating that genetic risk.

For years, researchers have stressed the importance of regular exercise to combat the genetic predisposition to obesity. To find out which kinds of exercise most effectively blunt the effects of obesity genes, Wan-Yu Lin and Po-Hsiu Kuo at the National Taiwan University in Taipei and their colleagues recruited 18,424 Taiwanese adults whose genomes had been sequenced. The researchers asked participants about their exercise routines and calculated each person’s genetic risk for five aspects of obesity, including body-fat percentage and hip circumference.

Jogging, which mitigated the genetic effects of three signs of obesity, was the most effective exercise. But relatively long sessions of yoga also helped to control obesity, as did fast walking and some forms of ballroom dancing, such as the foxtrot and the waltz.