There are many different reasons you can’t touch your toes. Always look deeper before stretching anything.
Just because the hamstrings are tight doesn’t mean they need stretching.
Can you reach them? If not, that means your hamstrings are too tight and they need stretching.