Consuming too much alcohol could help raise the risk of developing dementia later in life, according to a new study. But there’s a twist: The same study says that completely abstaining from liquor could up the dangers of developing the disease.

Researchers from Paris and London followed more than 9,000 individuals, over a 23-year period, to try and determine alcohol consumption’s linkage to dementia. They found that both complete abstinence, along with heavy drinking, were associated with an increased risk of dementia.

Almost 400 cases of dementia were recorded in the population during the study period, at a mean age of about 76. Researchers found that abstinence in midlife spelled a higher risk of dementia compared to those who consumed 1 to 14 units of alcohol per week. In the heavy drinking segment — with those drinking more than 14 units each week — a seven-unit increase in alcohol consumption spelled a 17% increase in risk of dementia.

“Given the number of people living with dementia is expected to triple by 2050 and the absence of a cure, prevention is key,” the study concludes. “The UK guidelines suggest an alcohol threshold of 14 units/week but many countries use a much higher threshold to define excessive consumption. The present study encourages the use of a lower threshold of alcohol consumption in such guidelines, applicable over the adult life course, in order to promote cognitive health.”