PIPE
  • Труба  (Slovakia, Final Second Round, 2002)
    PIPE


Description
The Piping Research Institute has a new problem, this time with a system of oriented pipes. In order to clean this type of system, it is required that the cleaning robot will pass each pipe exactly once. The pipe system is oriented - a direction, in which the robot must pass the pipes has been already decided for each pipe. The programmers of the PRI wrote a program, which will find, for a given system, one possible path for the cleaning robot or it will determine that no such path exists. However, it is sometimes important to know whether there exist more than one such path (the robot lifetime is prolonged by alternating the cleaning paths).

A set of pipes consists of n nodes numbered 1, ..., n with m unidirectional pipes numbered 1, ..., m. Each pipe connects two (different) nodes, doesn't branch or cross with other pipes. Each pair of nodes is connected with at most one pipe. It is guaranteed that there exists a path for a robot starting and ending in the node 1 that is passing through each pipe exactly once and in the correct direction. 

Task
The researchers of PRI found this path using their program, and it is at your disposition. Your task is to figure out whether there exists a different path starting and ending in the node 1, passing each pipe exactly once and in the correct direction. Your program doesn't have to write this path out, the answer should be YES or NO.


Examples:

PIPE.IN
(n=5, m=7)
5
7

1   2
1   5
2   3
3   1
3   4
4   1
5   3


Path:
1  2  3  4  1  5  3  1

PIPE.OUT
YES

Note: 1  2  3  1  5  3  4  1 is an example of a different path




PIPE.IN  (n=5, m=6)
5
6

1   2
2   3
3   1
3   4
4   5
5   3


Path: 1  2  3  4  5  3  1

PIPE.OUT
NO