Sure, no type of TV is great for kids. But some types of shows are certainly better than others. And, according to a new study, this is particularly true when it comes to associations with mental health problems.

For the study, published in JAMA Pediatrics, researchers asked parents of nearly 16,000 children in Shanghai, China, about their kids’ total screen time and what it consisted of (They didn’t analyze specific TV shows, but rather looked at types of TV shows). Researchers began asking parents when kids were in kindergarten and then checked in with them two more times until kids reached the age of 6. They also surveyed the parents to determine whether the kids had mental health problems.

The researchers found that, unsurprisingly, more total screen time was associated with a higher risk for mental health problems.

More interestingly, they also found that under a given total screen time, kids who watched proportionally more educational programs — for example, Sesame Street — had less mental health issues. Those who watched proportionally more non-child-directed programs, which could include anything from a nature documentary to an R-rated horror movie, had a higher risk.

It’s important to note that the educational shows didn’t protect kids’ mental health. They still contributed to total screen time, which increased risk of mental health problems. But compared to other forms of screen time, it was the lesser of the evils.

The researchers also looked at social media, entertainment programs for kids like Thomas & Friends, and playing computer or video games and found that they weren’t associated with a higher or lower risk of developing mental health problems compared to other forms of screen time.

The reason educational kids’ shows are associated with a lower risk of mental health problems may be their slower pace, which doesn’t overstimulate kids’ developing brains. Previous studies have found paster-paced programs to impair executive functioning. Additionally, prosocial elements of these shows, like characters talking or singing directly to the audience, can scaffold kids’ developing abilities, helping their social skills and well-being.

Non-child-directed shows are linked to a higher risk of both internalizing mental health issues like depression and anxiety and externalizing mental health problems like impulsive behavior, the study found. This may be because they provide too much stimulus. Such shows may also contain inappropriate elements like violence that could increase the risk for antisocial behavior. And parents watching these programs with their children are probably more immersed and less engaged with their kids than if they were watching a kids’ show with them.

They study provides strong evidence for not letting the kids join in when you’re watching TV or a movie for your own enjoyment. Rather, it’s a reminder to save your TV watching for after you put the kids to bed, limit kids’ screen time, and, if you are going to put something on for them, opt for something educational.