If you’re wondering whether you should have another cup of coffee to stay up late or crack open a cold beer to wind down the day, consider this: new research says the yeast in beer may prevent cellular aging.

According to a study conducted at Tel Aviv University (TAU), caffeine and alcohol have drastically different effects on the human genome. Specifically, one shortens and one lengthens telomeres, the end caps on DNA strands that emerging science says may be indicators for aging and cancer. 

The team, led by Martin Kupiec, a professor of molecular microbiology and biotechnology at TAU, used cells from yeast to explore how different environmental factors can affect our DNA.

“For the first time we've identified a few environmental factors that alter telomere length, and we've shown how they do it,” Kupiec said in a statement. “What we learned may one day contribute to the prevention and treatment of human diseases.”

The study was published in the journal PLOS Genetics.

Want to Live Longer? Try These Foods That Help You Heal »

Coffee and Alcohol Impact Cellular Life

Telomeres are essential proteins that ensure strands of DNA are copied and repaired properly. Every time a cell duplicates, its telomeres become shorter, and when they become too short, the cell dies.

A 2004 study by molecular biologist Elizabeth Blackburn—recipient of the 2009 Nobel Prize in Physiology or Medicine—found that telomeres respond to emotional stress and may generate free radicals in cells.

The TAU team expanded on this research by exposing yeast cells to environmental stressors, such as temperature and pH changes and specific chemicals.

While most of the stressors had no impact on telomere length, just the amount of caffeine found in a shot of espresso shortened telomeres, while the amount of alcohol found in your average domestic beer lengthened them.

Read More: Bariatric Surgery Slows Aging on the Cellular Level »

To find out more, the TAU team scanned 6,000 strains of the yeast, each with a different gene deactivated, and tested them to determine their telomere length.

They found that about 400 yeast genes—many of which are the same as in the human genome—are involved in determining telomere length. Researchers said this underscores the importance of the network involved in maintaining the stability of the genome.

“It turns out that telomere length is something that's very exact, which suggests that precision is critical and should be protected from environmental effects,” Kupiec said.

Like many things in life, there are benefits and risks involved in consuming caffeine and alcohol. Numerous studies have shown how both chemicals hurt and can help the body.

Kupiec suggests this: “Try to relax and drink a little coffee and a little beer.”

Read More: 13 Potential Health Benefits of a Cup of Coffee »