Everyone’s sleep schedule is a little bit different: Some people like to wake up early, others prefer to stay up late. But whether you’re a night owl or a morning person, the reason for your sleep patterns might be genetic.

A study published in the journal Nature Communications analyzed the data of nearly 700,000 people — and tracked another 85,000 with activity monitors — to determine the “chronotypes,” in other words the time-of-day preferences, of the participants.

The study identified as many as 351 genetic factors that impact circadian rhythms, the daily cycles of your body that monitor everything from hormone levels to body temperature, as well as sleep.

Individuals who had the most “morningness alleles” woke up about 25 minutes earlier than those with the fewest. The research also indicated that morning people have better mental health than night owls do. The genes associated with early rising were associated with well-being and a decreased risk of depression and schizophrenia.

Michael Weedon, the co-author of the study, speculated for why this might be the case in an interview with CNN. Morning people might simply have an easier time of it in a world where the workday starts early. “[They] are better aligned with a 9-to-5-type society,” Weedon explained.

The research also indicated that morning people have better mental health than night owls do.

The genes that help with morning “reset” were found in some unlikely places, including one in the retinal tissue of the eye. “It could be that these genes in the eyes help morning people detect light and ‘reset’ their body clock more effectively,” said Weedon.

Weedon has high hopes for how these findings might improve sleep schedules in the future — possibly even through medication to help with sleep-pattern disruption. What does Weedon see as one possible application? “Jet lag,” he said. That’s something that both night owls and early birds can get behind.