Does physical activity buffer insomnia due to back and neck pain?

Does physical activity buffer insomnia due to back and neck pain?