If you want to know whether a YAML document such as you have presented is valid, I suggest looking at the YAML spec to see what it says. I'm not a YAML expert, so I don't have any idea, myself.
If you have a file like this and you want to get it loaded, I suggest fixing the file. You could also try loading it with different YAML implementations to see if any will take it.