Does sunlight protect us from cancer?

Does sunlight protect us from cancer?