Lack of sleep can make you fat. This part of the obesity puzzle isn’t quite new—research has already shown that sleep deprivation can change how your cells respond to insulin and even how your genes affect your weight.

But a recent study found that too little sleep may also affect men and women differently, especially when it comes to appetite.

In the new study, published in the journal SLEEP, researchers found that after four days of sleeping only four hours a night, participants’ hormone levels changed—men saw increased levels of a hormone that stimulates appetite, and women had less of a hormone that signals fullness.

The people in the study didn’t actually report feeling hungrier when sleep deprived, but when they were allowed to eat as much as they wanted? Both men and women tended to overeat— by a whopping 300 calories. Researchers think the overtired men tended to be hungrier, while the sleepy women took longer to feel full.

The connection between lack of sleep and obesity is strong, but while the scientists sort out the details, here are some tips to avoid sleep-related weight gain:

Get enough sleep. It seems simple, but it’s effective. For most adults, this means 7 to 9 hours a night.

Watch your snacking after a restless night. You may unconsciously reach for sweet and salty foods. Beat these urges by sticking to your regular meals.

Keep exercising. Regular physical activity is a double-edge sword. It can burn calories to keep excess weight off, but may also help you sleep better.