n,m=map(int,input().split())
print('YES')
print(2*m)
ans=[]
for i in range(m):
    a,b=map(int,input().split())
    ans.append([i for i in range(1,n+1) if i!=a and i!=b]+[a,b])
    ans.append([a,b]+[i for i in range(n,0,-1) if i!=a and i!=b])
print('\n'.join(' '.join(str(j) for j in i) for i in ans))