Bear Limak examines a social network. Its main functionality is that two members can become friends (then they can talk with each other and share funny pictures).

There are *n* members, numbered 1 through *n*. *m* pairs of members are friends. Of course, a member can't be a friend with themselves.

Let A-B denote that members A and B are friends. Limak thinks that a network is reasonable if and only if the following condition is satisfied: For every three distinct members (X, Y, Z), if X-Y and Y-Z then also X-Z.

For example: if Alan and Bob are friends, and Bob and Ciri are friends, then Alan and Ciri should be friends as well.

Can you help Limak and check if the network is reasonable? Print "YES" or "NO" accordingly, without the quotes.
The first line of the input contain two integers *n* and *m* (3 ≤ *n* ≤ 150 000, <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/b42f66704052fe39dd9de801c578ecf53d48d0fe.png" style="max-width: 100.0%;max-height: 100.0%;"/>) — the number of members and the number of pairs of members that are friends.

The *i*-th of the next *m* lines contains two distinct integers *a*<sub class="lower-index">*i*</sub> and *b*<sub class="lower-index">*i*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub>, *b*<sub class="lower-index">*i*</sub> ≤ *n*, *a*<sub class="lower-index">*i*</sub> ≠ *b*<sub class="lower-index">*i*</sub>). Members *a*<sub class="lower-index">*i*</sub> and *b*<sub class="lower-index">*i*</sub> are friends with each other. No pair of members will appear more than once in the input.
The drawings below show the situation in the first sample (on the left) and in the second sample (on the right). Each edge represents two members that are friends. The answer is "NO" in the second sample because members (2, 3) are friends and members (3, 4) are friends, while members (2, 4) are not.
4 3
1 3
3 4
1 4
YES
4 4
3 1
2 3
3 4
1 2
NO
10 4
4 3
5 10
8 9
1 2
YES
3 2
1 2
2 3
NO
3 0
YES
15 42
8 1
3 14
7 14
12 3
7 9
6 7
6 12
14 12
3 10
10 14
6 3
3 13
13 10
7 12
7 2
6 10
11 4
9 3
8 4
7 3
2 3
2 10
9 13
2 14
6 14
13 2
1 4
13 6
7 10
13 14
12 10
13 7
12 2
9 10
13 12
2 6
9 14
6 9
12 9
11 1
2 9
11 8
YES
20 80
17 4
10 1
11 10
17 7
15 10
14 15
13 1
18 13
3 13
12 7
9 13
10 12
14 12
18 11
4 7
10 13
11 3
19 8
14 7
10 17
14 3
7 11
11 14
19 5
10 14
15 17
3 1
9 10
11 1
4 1
11 4
9 1
12 3
13 7
1 14
11 12
7 1
9 12
18 15
17 3
7 15
4 10
7 18
7 9
12 17
14 18
3 18
18 17
9 15
14 4
14 9
9 18
12 4
7 10
15 4
4 18
15 13
1 12
7 3
13 11
4 13
5 8
12 18
12 15
17 9
11 15
3 10
18 10
4 3
15 3
13 12
9 4
9 11
14 17
13 17
3 9
13 14
1 17
15 1
17 11
NO
99 26
64 17
48 70
71 50
3 50
9 60
61 64
53 50
25 12
3 71
71 53
3 53
65 70
9 25
9 12
59 56
39 60
64 69
65 94
70 94
25 60
60 12
94 48
17 69
61 17
65 48
61 69
NO
3 1
1 2
YES
3 2
3 2
1 3
NO
3 3
2 3
1 2
1 3
YES
4 2
4 1
2 1
NO
4 3
3 1
2 1
3 2
YES
5 9
1 2
5 1
3 1
1 4
2 4
5 3
5 4
2 3
5 2
NO
10 5
9 5
1 2
6 8
6 3
10 6
NO
10 8
10 7
9 7
5 7
6 8
3 5
8 10
3 4
7 8
NO
10 20
8 2
8 3
1 8
9 5
2 4
10 1
10 5
7 5
7 8
10 7
6 5
3 7
1 9
9 8
7 2
2 10
2 1
6 4
9 7
4 3
NO
150000 10
62562 50190
48849 60549
139470 18456
21436 25159
66845 120884
99972 114453
11631 99153
62951 134848
78114 146050
136760 131762
YES
150000 0
YES
4 4
1 2
2 3
3 4
1 4
NO
30 73
25 2
2 16
20 12
16 20
7 18
11 15
13 11
30 29
16 12
12 25
2 1
18 14
9 8
28 16
2 9
22 21
1 25
12 28
14 7
4 9
26 7
14 27
12 2
29 22
1 9
13 15
3 10
1 12
8 20
30 24
25 20
4 1
4 12
20 1
8 4
2 28
25 16
16 8
20 4
9 12
21 30
23 11
19 6
28 4
29 21
9 28
30 10
22 24
25 8
27 26
25 4
28 20
9 25
24 29
20 9
18 26
1 28
30 22
23 15
28 27
8 2
23 13
12 8
14 26
16 4
28 25
8 1
4 2
9 16
20 2
18 27
28 8
27 7
NO
5 4
1 2
2 5
3 4
4 5
NO
4 4
1 2
2 3
3 4
4 1
NO
6 6
1 2
2 4
4 3
1 5
5 6
6 3
NO
3 2
1 2
1 3
NO
6 6
1 2
2 3
3 4
4 5
5 6
1 6
NO
4 4
1 2
1 3
2 4
3 4
NO
6 9
1 4
1 5
1 6
2 4
2 5
2 6
3 4
3 5
3 6
NO
4 3
1 2
1 3
3 4
NO
4 3
1 2
1 3
2 4
NO
6 6
1 2
2 3
3 4
4 5
5 6
6 1
NO
4 3
1 2
1 3
1 4
NO
150000 3
150000 149999
149998 149999
149998 150000
YES
10 15
1 2
1 3
2 4
2 5
3 4
3 5
4 5
1 6
6 7
6 8
7 9
7 10
8 9
8 10
9 10
NO
5 5
1 2
2 3
3 4
4 5
5 1
NO
5 4
1 2
1 3
1 4
1 5
NO
9 9
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 1
NO
4 5
1 2
1 3
1 4
2 3
3 4
NO
4 4
1 2
1 3
4 2
4 3
NO
5 5
1 4
5 3
5 1
2 3
4 5
NO
4 5
1 2
1 3
2 3
1 4
2 4
NO
4 5
1 2
1 3
1 4
2 3
2 4
NO
6 12
1 2
1 4
1 5
1 6
2 3
2 5
2 6
3 4
3 5
3 6
4 5
4 6
NO
1000 4
100 132
100 164
196 132
196 164
NO
n, m = map(int, input().split())

dic = {}
visited = set()
answer = 'YES'

for i in range(m):
  a, b = map(int, input().split())
  dic.setdefault(a, {a}).add(b)
  dic.setdefault(b, {b}).add(a)

for i, j in dic.items():
  if i not in visited:
    if all([dic[aux]==j for aux in j]):
      visited.update(j)
    else:
      answer = 'NO'
      break

print (answer)
	  	 						    	    	  	     		