#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n, m, i, j, z;
  pair<long long, long long> temp;
  cin >> n >> m;
  if (n == 1)
    cout << "NO";
  else if (m == (n * (n - 1)) / 2)
    cout << "NO";
  else {
    cout << "YES" << endl;
    vector<vector<long long> > A(n + 1, vector<long long>());
    for (i = 0; i < m; i += 1) {
      cin >> temp.first >> temp.second;
      A[temp.first].push_back(temp.second);
      A[temp.second].push_back(temp.first);
    }
    vector<long long> one(n + 1, -1), two(n + 1, -1);
    for (i = 1; i <= n; i += 1) {
      if (A[i].size() != n - 1) {
        one[i] = 1;
        two[i] = 2;
        z = 3;
        for (j = 0; j < A[i].size(); j += 1) {
          one[A[i][j]] = z;
          two[A[i][j]] = z;
          z += 1;
        }
        break;
      }
    }
    for (i = 1; i <= n; i += 1) {
      if (one[i] == -1) {
        one[i] = 2;
        two[i] = 2;
        break;
      }
    }
    for (; i <= n; i += 1) {
      if (one[i] == -1) {
        one[i] = z;
        two[i] = z;
        z += 1;
      }
    }
    for (i = 1; i <= n; i += 1) cout << one[i] << " ";
    cout << endl;
    for (i = 1; i <= n; i += 1) cout << two[i] << " ";
  }
  return 0;
}
