#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
signed main() {
  long long n, m;
  cin >> n >> m;
  long long a[n];
  for (long long i = 2; i < n; i++) a[i] = i + 1;
  vector<long long> b[n];
  for (long long i = 0; i < m; i++) {
    long long x, y;
    cin >> x >> y;
    x--;
    y--;
    b[x].emplace_back(y);
    b[y].emplace_back(x);
  }
  for (long long i = 0; i < n; i++)
    if (b[i].size() != n - 1) {
      b[i].emplace_back(i);
      sort(b[i].begin(), b[i].end());
      for (long long j = 0; j < n; j++) {
        if (b[i][j] != j) {
          cout << "YES\n";
          long long g = 2;
          for (long long k = 0; k < n; k++) {
            if (k == i)
              cout << "1 ";
            else if (k == j)
              cout << "2 ";
            else
              cout << a[g++] << " ";
          }
          cout << endl;
          g = 2;
          for (long long k = 0; k < n; k++) {
            if (k == i || k == j)
              cout << "1 ";
            else
              cout << a[g++] << " ";
          }
          return 0;
        }
      }
    }
  cout << "NO\n";
  return 0;
}
