/* 只要找到两个没有关系的点即可 */ #include<bits/stdc++.h> using namespace std; #define maxn 100005 long long n,m; int a[maxn],b[maxn]; vector<int>G[maxn]; int main(){cin>>n>>m;if(n==1){puts("NO");return 0;}if(n*(n-1)/2<=m){puts("NO");return 0;}puts("YES");/* if(n==2){puts(" ");puts("1 2");puts("1 1");return 0;} */ for(int i=1;i<=m;i++){int a,b;cin>>a>>b;G[a].push_back(b);G[b].push_back(a);}for(int i=1;i<=n;i++)G[i].push_back(i);for(int i=1;i<=n;i++)sort(G[i].begin(),G[i].end());int pos1,pos2;for(int i=1;i<=n;i++){if(G[i].size()==n)continue;for(int j=1;j<=G[i].size();j++)if(j!=G[i][j-1]){pos1=i;pos2=j;break;}}int i=0;for(int j=1;j<=n;j++)if(j==pos1)cout<<n<<" ";else if(j==pos2)cout<<n-1<<" ";else cout<<++i<<" ";puts("");i=0;for(int j=1;j<=n;j++)if(j==pos1 || j==pos2)cout<<n-1<<" ";else cout<<++i<<" "; }