n,m = map(int,input().split()) print("YES") print(2*m) for i in range(m): a,b = map(int,input().split()) x = list(i for i in range(1,n+1) if i not in [a,b]) print(* ([a,b] + x)) print(*(x[::-1] + [a,b]))