Sleeping positions

Is it safe to sleep on your back while pregnant? My app told me to start sleeping on my sides but didn’t say why and I honestly think it’s more comfortable to sleep on my back