Hexadecimal likes drawing. She has drawn many graphs already, both directed and not. Recently she has started to work on a still-life «interesting graph and apples». An undirected graph is called interesting, if each of its vertices belongs to one cycle only — a funny ring — and does not belong to any other cycles. A funny ring is a cycle that goes through all the vertices just once. Moreover, loops are funny rings too.

She has already drawn the apples and some of the graph edges. But now it is not clear, how to connect the rest of the vertices to get an interesting graph as a result. The answer should contain the minimal amount of added edges. And furthermore, the answer should be the lexicographically smallest one. The set of edges (*x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>), (*x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub>), ..., (*x*<sub class="lower-index">*n*</sub>, *y*<sub class="lower-index">*n*</sub>), where *x*<sub class="lower-index">*i*</sub> ≤ *y*<sub class="lower-index">*i*</sub>, is lexicographically smaller than the set (*u*<sub class="lower-index">1</sub>, *v*<sub class="lower-index">1</sub>), (*u*<sub class="lower-index">2</sub>, *v*<sub class="lower-index">2</sub>), ..., (*u*<sub class="lower-index">*n*</sub>, *v*<sub class="lower-index">*n*</sub>), where *u*<sub class="lower-index">*i*</sub> ≤ *v*<sub class="lower-index">*i*</sub>, provided that the sequence of integers *x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub>, ..., *x*<sub class="lower-index">*n*</sub>, *y*<sub class="lower-index">*n*</sub> is lexicographically smaller than the sequence *u*<sub class="lower-index">1</sub>, *v*<sub class="lower-index">1</sub>, *u*<sub class="lower-index">2</sub>, *v*<sub class="lower-index">2</sub>, ..., *u*<sub class="lower-index">*n*</sub>, *v*<sub class="lower-index">*n*</sub>. If you do not cope, Hexadecimal will eat you. ...eat you alive.
The first line of the input data contains a pair of integers *n* and *m* (1 ≤ *n* ≤ 50, 0 ≤ *m* ≤ 2500) — the amount of vertices and edges respectively. The following lines contain pairs of numbers *x*<sub class="lower-index">*i*</sub> and *y*<sub class="lower-index">*i*</sub> (1 ≤ *x*<sub class="lower-index">*i*</sub>, *y*<sub class="lower-index">*i*</sub> ≤ *n*) — the vertices that are already connected by edges. The initial graph may contain multiple edges and loops.
none
3 2
1 2
2 3
YES
1
1 3
1 1
1 1
YES
0
1 2
1 1
1 1
NO
1 3
1 1
1 1
1 1
NO
2 0
YES
2
1 2
1 2
2 1
1 1
NO
2 1
2 2
NO
2 1
2 1
YES
1
1 2
2 2
1 1
2 2
NO
2 2
1 2
2 1
YES
0
2 3
1 1
1 2
2 1
NO
3 2
1 2
1 2
NO
1 0
YES
1
1 1
4 3
1 2
1 3
1 4
NO
6 6
1 2
2 3
3 1
4 5
5 6
6 1
NO
49 0
YES
49
1 2
1 3
2 4
3 5
4 6
5 7
6 8
7 9
8 10
9 11
10 12
11 13
12 14
13 15
14 16
15 17
16 18
17 19
18 20
19 21
20 22
21 23
22 24
23 25
24 26
25 27
26 28
27 29
28 30
29 31
30 32
31 33
32 34
33 35
34 36
35 37
36 38
37 39
38 40
39 41
40 42
41 43
42 44
43 45
44 46
45 47
46 48
47 49
48 49
50 0
YES
50
1 2
1 3
2 4
3 5
4 6
5 7
6 8
7 9
8 10
9 11
10 12
11 13
12 14
13 15
14 16
15 17
16 18
17 19
18 20
19 21
20 22
21 23
22 24
23 25
24 26
25 27
26 28
27 29
28 30
29 31
30 32
31 33
32 34
33 35
34 36
35 37
36 38
37 39
38 40
39 41
40 42
41 43
42 44
43 45
44 46
45 47
46 48
47 49
48 50
49 50
50 1
2 3
YES
49
1 2
1 4
3 5
4 6
5 7
6 8
7 9
8 10
9 11
10 12
11 13
12 14
13 15
14 16
15 17
16 18
17 19
18 20
19 21
20 22
21 23
22 24
23 25
24 26
25 27
26 28
27 29
28 30
29 31
30 32
31 33
32 34
33 35
34 36
35 37
36 38
37 39
38 40
39 41
40 42
41 43
42 44
43 45
44 46
45 47
46 48
47 49
48 50
49 50
3 2
1 2
2 3
YES
1
1 3
5 3
3 5
4 2
5 1
YES
2
1 2
3 4
6 6
4 3
3 5
6 4
1 6
2 1
5 2
YES
0
7 4
3 2
2 6
6 7
1 5
YES
3
1 3
4 5
4 7
8 5
4 7
3 6
8 3
6 5
1 2
YES
3
1 4
2 5
7 8
9 5
5 2
4 6
8 4
1 8
2 1
YES
4
3 5
3 7
6 9
7 9
3 3
1 3
2 1
3 2
YES
0
4 3
1 2
4 1
2 3
YES
1
3 4
5 2
1 5
5 4
YES
3
1 2
2 3
3 4
6 3
3 4
1 3
2 5
YES
3
1 2
4 6
5 6
7 6
5 6
2 7
7 3
4 1
1 5
3 4
YES
1
2 6
4 1
3 1
YES
3
1 2
2 4
3 4
8 3
3 8
2 6
1 7
YES
5
1 2
3 4
4 5
5 6
7 8
9 4
7 6
2 8
3 5
8 3
YES
5
1 2
1 4
4 6
5 9
7 9
45 22
15 23
14 30
5 44
43 21
24 17
37 38
40 9
41 43
7 4
38 22
26 18
44 41
42 11
4 33
35 24
36 15
19 1
1 37
9 35
12 40
31 29
18 25
YES
23
2 3
2 5
3 6
6 7
8 10
8 11
10 12
13 14
13 16
16 17
19 20
20 21
22 23
25 27
26 28
27 29
28 30
31 32
32 33
34 36
34 39
39 45
42 45
46 25
44 40
25 10
28 44
26 4
38 7
27 3
46 8
32 28
22 20
14 33
30 14
12 23
13 30
40 18
37 35
10 16
23 22
3 46
36 24
19 12
18 42
11 34
34 36
9 32
24 19
YES
21
1 2
1 4
2 5
5 6
6 7
8 9
11 13
15 16
15 17
17 20
21 25
21 26
27 29
29 31
31 33
35 38
37 39
39 41
41 43
42 45
43 45
47 26
24 2
13 24
25 14
35 6
4 10
11 18
29 41
37 13
38 3
2 31
30 29
6 42
33 25
41 45
40 8
28 47
43 39
39 38
1 5
45 22
19 21
18 37
36 17
27 28
16 11
12 30
YES
21
1 3
4 5
7 8
7 9
9 10
12 14
15 16
15 17
19 20
20 22
21 23
23 26
26 27
31 32
32 33
34 35
34 36
40 42
43 44
44 46
46 47
48 26
27 5
13 21
14 20
41 31
4 26
21 39
31 17
18 4
42 2
28 43
11 23
35 22
34 18
23 15
10 13
7 48
5 44
19 25
12 7
15 27
39 41
33 10
45 40
20 42
29 38
17 28
YES
22
1 2
1 3
3 6
6 8
8 9
9 11
12 14
16 19
16 22
24 25
24 26
29 30
30 32
32 33
34 36
35 37
36 38
37 40
43 44
45 46
46 47
47 48
49 26
33 34
43 21
26 27
46 33
32 47
6 3
44 14
34 42
4 8
27 29
12 4
42 7
22 16
5 31
35 24
39 40
20 12
17 44
8 18
38 26
48 39
31 17
9 19
10 23
1 30
49 38
YES
23
1 2
2 3
5 6
7 9
10 11
11 13
13 14
15 16
15 18
19 20
21 22
23 24
25 28
25 29
28 30
32 35
36 37
36 40
37 41
41 43
45 46
45 47
48 49
50 21
27 16
42 35
15 28
46 17
30 39
47 18
35 25
26 24
24 30
28 41
40 38
11 21
33 20
43 10
37 14
1 43
32 49
49 6
10 45
21 50
39 3
YES
29
1 2
2 3
4 5
4 6
5 7
7 8
8 9
9 11
12 13
12 14
13 15
16 17
18 19
19 20
22 23
22 25
23 26
27 29
29 31
31 32
33 34
34 36
36 37
38 41
40 42
44 45
44 46
47 48
48 50
30 21
6 14
19 17
25 20
28 10
10 3
24 23
22 13
1 7
11 26
12 1
16 8
14 9
30 15
4 27
13 21
20 12
24 14
19 10
7 10
16 8
26 11
NO
31 24
6 25
8 13
29 20
13 5
26 8
16 9
31 2
22 7
24 21
28 18
9 12
27 14
20 24
23 10
10 27
15 1
21 28
11 16
12 29
8 7
10 28
27 19
17 3
23 16
NO
5 2
1 3
4 1
YES
3
2 3
2 5
4 5
32 24
9 15
32 16
26 7
15 8
30 21
23 14
22 17
14 29
19 1
24 31
3 22
20 9
5 23
10 3
27 24
1 30
8 18
23 28
14 4
27 10
11 9
11 24
11 18
17 6
NO
33 19
27 23
17 16
20 33
3 11
1 31
26 24
25 10
21 15
14 9
12 4
29 2
7 21
32 13
33 6
5 26
13 28
6 22
3 24
27 19
YES
14
1 2
4 5
7 8
8 9
10 11
12 14
15 16
17 18
18 19
20 23
22 28
25 29
30 31
30 32
34 18
9 14
30 23
19 3
34 19
26 2
31 28
7 21
20 27
16 15
18 20
5 34
17 22
10 12
6 4
8 32
29 24
24 10
34 22
NO
35 28
6 24
35 10
14 19
30 34
29 23
21 16
34 5
22 6
7 35
13 29
27 3
8 27
5 15
26 11
19 1
31 28
17 31
18 20
12 32
4 17
10 4
32 8
35 18
9 5
33 30
24 25
12 12
34 3
NO
36 23
27 31
33 14
17 24
14 25
3 8
1 21
24 27
13 26
23 6
35 22
34 33
36 4
19 16
18 15
32 36
5 7
20 30
21 11
11 27
8 23
6 10
4 31
15 31
NO
37 22
2 15
37 11
14 29
9 37
15 23
24 35
18 3
23 12
34 33
4 19
22 14
21 26
28 27
12 36
8 6
26 28
31 1
29 5
27 25
17 10
33 18
35 20
YES
15
1 2
3 4
5 6
7 8
7 9
10 11
13 16
13 17
16 19
20 21
22 24
25 30
30 31
32 34
32 36
38 30
21 36
20 21
9 11
27 10
25 20
33 16
11 23
31 4
13 22
36 27
32 37
12 6
35 31
5 34
6 14
7 38
26 18
4 24
18 5
23 17
29 28
38 13
10 30
18 3
15 25
1 24
22 22
17 22
36 18
23 13
NO
39 25
8 23
27 38
6 32
20 33
7 34
22 26
32 12
23 2
28 20
33 35
18 10
1 21
11 18
39 28
17 9
36 8
15 17
14 1
19 24
37 30
21 39
38 13
28 5
36 30
33 13
NO
40 29
23 2
40 16
35 31
2 40
39 35
18 11
21 7
3 6
15 5
4 18
17 19
8 34
16 17
9 39
37 21
19 26
26 36
33 4
10 9
34 22
13 20
32 40
35 11
5 12
14 5
5 24
40 6
32 35
21 21
NO
41 28
6 28
1 38
11 7
12 26
10 36
9 21
8 3
2 20
33 32
21 40
34 10
22 15
30 22
5 12
19 35
13 6
31 37
25 4
15 23
37 33
19 19
20 6
14 8
9 12
27 33
28 27
37 11
36 20
NO
6 1
4 1
YES
5
1 2
2 3
3 5
4 6
5 6
42 28
7 19
15 24
3 42
18 5
32 27
26 20
40 30
35 2
14 8
22 10
36 4
16 14
21 29
37 40
2 12
30 21
19 17
39 34
31 28
20 3
4 33
11 42
26 21
9 10
4 32
6 1
1 14
14 12
NO
43 36
3 24
25 36
36 11
12 38
11 32
15 3
8 9
2 17
5 40
21 37
39 20
28 30
16 22
27 13
31 6
24 39
34 19
35 18
43 21
41 4
7 31
33 26
6 5
42 27
29 2
30 10
40 1
1 29
20 14
40 29
29 6
26 27
37 21
19 9
31 4
19 38
NO
44 31
28 26
5 36
9 37
36 29
26 5
25 42
30 22
29 3
35 10
44 28
18 13
16 6
3 33
22 9
4 15
27 19
17 11
19 41
11 25
10 30
2 34
12 7
37 31
16 40
25 24
28 44
41 37
21 21
12 28
20 23
20 17
NO
45 20
37 5
41 6
13 22
28 24
30 10
39 35
5 20
38 32
26 1
23 37
35 17
21 12
7 8
1 7
4 16
8 40
44 3
27 23
19 2
33 27
YES
25
2 3
4 6
9 10
9 11
11 12
13 14
14 15
15 16
17 18
18 19
20 21
22 24
25 26
25 28
29 30
29 31
31 32
33 34
34 36
36 39
38 40
41 42
42 43
43 45
44 45
46 24
24 43
38 20
8 38
22 13
25 24
40 35
21 10
7 39
18 5
33 19
26 7
1 27
43 26
9 17
3 44
44 14
20 11
5 2
15 32
23 8
10 37
27 23
43 23
33 25
NO
47 36
29 31
25 45
39 46
12 19
31 21
4 41
5 38
33 3
21 39
40 1
1 47
35 12
42 10
2 4
6 35
17 16
22 28
14 22
41 25
10 14
34 37
27 20
44 27
20 2
3 17
45 13
18 34
47 15
10 44
25 15
12 23
27 17
15 38
17 32
29 31
3 39
NO
48 32
45 23
17 3
2 48
47 20
27 18
13 28
18 26
26 21
48 31
21 9
43 19
34 43
10 36
14 17
6 12
3 11
15 1
23 37
37 13
42 40
35 5
16 7
40 44
4 29
24 25
5 16
31 45
39 22
46 34
22 30
28 33
33 41
YES
16
1 2
4 6
7 8
8 9
10 11
12 14
15 19
20 24
25 27
29 30
32 35
32 36
38 39
38 41
42 46
44 47
49 29
43 18
44 26
49 31
37 19
20 16
18 22
30 5
7 28
12 2
31 11
27 43
25 9
19 4
35 25
4 30
6 27
46 41
38 23
17 37
13 8
11 38
29 20
40 10
22 29
36 7
17 36
35 48
41 36
39 27
NO
50 27
10 7
32 9
17 33
25 34
47 28
23 16
15 46
41 50
18 24
27 19
35 36
19 38
50 31
31 40
4 14
1 11
6 48
33 35
36 30
39 12
28 45
2 1
22 13
3 49
29 36
7 34
36 8
NO
7 3
7 4
5 2
1 3
YES
4
1 2
3 4
5 6
6 7
8 4
1 7
2 4
6 2
5 8
YES
4
1 3
3 4
5 6
7 8
9 2
2 5
1 6
YES
7
1 2
3 4
3 5
4 7
6 8
7 9
8 9
3 2
3 2
2 1
YES
1
1 3
4 2
3 1
4 2
YES
2
1 2
3 4
def dfs(v, graph):
	isloop = False
	lo, ro = graph

	# expand right
	pr, r = lo, ro
	expand_right = []
	while True:
		if len(v[r]) == 1:
			break
		else:
			nr1, nr2 = v[r]
			rn = nr1 if nr1 != pr else nr2
			expand_right.append(rn)
			if rn == lo: # we found loop
				isloop = True
				break
			pr = r
			r = rn

	if isloop:
		return True, graph + expand_right

	# expand left
	l, pl = lo, ro
	expand_left = []
	while True:
		if len(v[l]) == 1:
			break
		else:
			nl1, nl2 = v[l]
			nl = nl1 if nl1 != pl else nl2
			expand_left.append(nl)
			pl = l
			l = nl

	final_graph = expand_left[::-1] + graph + expand_right
	# if final_graph[0] > final_graph[-1]:
	# 	final_graph = final_graph[::-1]

	if len(final_graph) == 2:
		return True, final_graph
	else:
		return False, final_graph

def findMinvalInLineEnds(lines):
	minval, minval_idx = 0xFFFF, None
	secval, secval_idx = 0xFFFF, None

	for i in range(len(lines)):
		if lines[i][0] < minval:
			minval = lines[i][0]
			minval_idx = i
		elif lines[i][0] < secval:
			secval = lines[i][0]
			secval_idx = (i, 0)
		if lines[i][-1] < secval:
			secval = lines[i][-1]
			secval_idx = (i,-1)

	return minval, minval_idx, secval, secval_idx

def greedyConnect(lines, points):
	edges = []
	points.sort()
	while len(lines) > 0 or len(points) > 0:
		minval_p = points[0] if len(points) > 0 else 0xFFFF
		secval_p = points[1] if len(points) > 1 else 0xFFFF
		minval_l, minval_idx_l, secval_l, secval_idx_l = findMinvalInLineEnds(lines)

		if minval_p < minval_l:
			if secval_p < minval_l: # connect 2 points to make a line
				edges.append((minval_p, secval_p))
				points = points[2:]
				lines.append([minval_p, secval_p])
			else: # connect point to the line
				edges.append((minval_p, minval_l))
				points = points[1:]
				li = minval_idx_l
				lines[li] = [minval_p, lines[li][-1]]
		else:
			# if minval is one end of line, we merge that line with a point or a line
			if minval_p < secval_l:
				edges.append((minval_l, minval_p))
				li = minval_idx_l
				lines[li][0] = minval_p
				if lines[li][0] > lines[li][-1]:
					lines[li] = [lines[li][-1], lines[li][0]]
				points = points[1:]
			else:
				edges.append((minval_l, secval_l))
				li = minval_idx_l
				li_s, ei_s = secval_idx_l

				if li == li_s: # created loop
					del lines[li]
				else:
					lines[li][0] = lines[li_s][-1] if ei_s == 0 else lines[li_s][0]
					if lines[li][0] > lines[li][-1]:
						lines[li] = [lines[li][-1], lines[li][0]]
					del lines[li_s]
	return edges

if __name__ == '__main__':
	n,m = tuple(map(int, input().split()))
	v = [[] for i in range(n)]

	for i in range(m):
		v1,v2 = tuple(map(int, input().split()))
		v1,v2 = v1-1,v2-1
		v[v1].append(v2)
		v[v2].append(v1)

	# validate input
	input_valid = True
	for i in range(n):
		if len(v[i]) > 2:
			input_valid = False
			break
		v[i].sort()

	if not input_valid:
		print('NO')
		exit()

	loops = []
	lines = []
	points = []

	visited = [False for i in range(n)]

	for i in range(n):
		if visited[i]:
			continue
		elif len(v[i]) == 0:
			points.append(i)
			visited[i] = True
		elif len(v[i]) == 1 and v[i] == i:
			loops.append([i,i])
			visited[i] = True
		else:
			isloop, graph = dfs(v,[i,v[i][0]])
			for gi in graph:
				visited[gi] = True
			if isloop:
				loops.append(graph)
			else:
				lines.append(graph)

	# print('loops')
	# for p in loops:
	# 	print('\t{}'.format([e+1 for e in p]))
	# print('lines')
	# for p in lines:
	# 	print('\t{}'.format([e+1 for e in p]))
	# print('points')
	# for p in points:
	# 	print('\t{}'.format(p+1))

	# We only need two ends of the line
	for li in range(len(lines)):
		e1,e2 = lines[li][0], lines[li][-1]
		lines[li] = [e1,e2] if e1<e2 else [e2,e1]

	edges = greedyConnect(lines, points)

	print('YES')
	print(len(edges))
	for v1,v2 in edges:
		v1 += 1
		v2 += 1
		if v1 < v2:
			print('{} {}'.format(v1,v2))
		else:
			print('{} {}'.format(v2,v1))