#D3151. DAG Trio (Easy)

    ID: 2619 Type: Default 2000ms 268MiB

DAG Trio (Easy)

DAG Trio (Easy)

This issue is the same configuration issue as G: DAG Trio (Hard), with only the constraints being different.

input

N M N \ M a1 b1 a_1 \ b_1 a2 b2 a_2 \ b_2  vdots \ vdots aM bM a_M \ b_M

output

Print "YES" or "NO" on the 1 1 line.

Example

Input

3 3 1 2 2 3 3 1

Output

YES

inputFormat

input

N M N \ M a1 b1 a_1 \ b_1 a2 b2 a_2 \ b_2  vdots \ vdots aM bM a_M \ b_M

outputFormat

output

Print "YES" or "NO" on the 1 1 line.

Example

Input

3 3 1 2 2 3 3 1

Output

YES

样例

3 3
1 2
2 3
3 1
YES