With all the crazy news about sexually transmitted disease (STD) statistics, it can be easy to jump to the conclusion that sex can only cause health problems. But if you are being smart about your partners and using protection, sex has many health benefits. From improving your health to bettering your mood, “doing the deed” can do a lot more than just feel good—it can be good for you, too.

1. Sex can give your immune system a boost.

New research suggests that having sex can actually strengthen your immune system. According to Psychology Today, researchers Wilkes University in Pennsylvania discovered that college students who had sex at least once or twice a week produced higher levels of the antibody, immunoglobulin (IGA). IGA is the antibody responsible for fighting the germs that enter the body through mucosal linings. In fact, those who were having sex twice a week had an immune response that was at least 33 percent higher than people who had no sex.

So while it may not be a good idea to engage in sexual intercourse when you are already suffering from a cold, having a healthy sex life may help prevent that cold. That is good news for ladies who tend to hibernate during the wintertime—it looks like sex may make this year’s flu season a little more bearable!

2. Sex can make you less stressed.

It is no coincidence that you feel much more relaxed after having sex—and there is science behind it. Studies have shown that intimacy and that “feeling of closeness” you share with your partner may relieve stress. Additionally, sexual intercourse may relieve stress and depression. According to a study conducted by Roy J. Levin of the University of Sheffield in Sheffield, England, hormones in semen contain substances that have been found to relax women, which is why women are in a better mood after a man ejaculates inside.

Similarly, if you have ever had an orgasm, you may recall feeling a sense of calmness after the “Big O.” That is because when you orgasm, your brain produces endorphins — the hormones that lift your mood, relieve stress, and are responsible for your overall happiness.

3. Having sex is good for your heart health.

While some doctors may have a hard time endorsing sex as a form of exercise, research has shown that having sex regularly can lower your risk of a heart attack. According to the health website, Mercola.com, men who have sex at least twice a week can almost halve their risk of heart disease and men who indulge in regular lovemaking are up to 45 percent less likely to develop life-threatening heart conditions. This may have something to do with the fact that people who have more sex tend to be less stressed.

Additionally, having sex will increase your heart rate, which will give your heart a healthy workout. While sexual intercourse may not be the most effective way to exercise, for men, having sex at least twice a week may cut your chances of having a heart attack by nearly a half.

 4. Having an orgasm can lessen pain.

Attention women—it looks like telling your man that you have a headache may no longer be a good excuse to avoid sex. As previously mentioned, orgasms help our brains produce the hormone endorphin. But did you know that endorphins also work as natural painkillers, too?

According to WebMD, orgasms can block pain, as the release of endorphins will help raise your pain threshold. And it looks like stimulation without orgasm can also help with pain. Research has shown that vaginal stimulation can block chronic back pain, leg pain, and even menstrual pain! That’s right, ladies. Having sex on your period, though it can get a little messy, may also help with cramps. So long as your partner isn’t totally grossed out by the idea, having sex on your period is totally fine—so go for it!

5. Frequent ejaculation may reduce your chance of developing prostate cancer.

Recent studies have shown that frequent ejaculation may reduce a man’s chance of developing prostate cancer. According to Medical Daily,  2004 JAMA study was among the first to suggest a modifiable risk factor, finding “high ejaculation frequency” may be associated with lower risk for prostate cancer.

The present research builds upon these findings with the “high-quality data” collected from nearly 32,000 men participating in the Health Professionals study. The results, which were collected over the course of 18 years, showed men who ejaculated at least 21 times a month reduced their risk for prostate cancer by 20 percent compared to men who ejaculated four to seven times a month.