- The output should contain a single line with a single word
- The word should be YES if there exists a simple path of length at least K in the input graph which satisfies the constraints mentioned and NO otherwise