- The output should contain a single line with a single word
- The word should be YES if a path exists in the input graph according to constraints specified above and NO otherwise