#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 50;
vector<long long> g[N];
long long a[N], b[N];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  if (m >= (n * (n - 1)) / 2) {
    return cout << "NO\n", 0;
  }
  cout << "YES\n";
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  long long l, r;
  for (long long i = 1; i <= n; i++) {
    if (g[i].size() == n - 1) continue;
    sort(g[i].begin(), g[i].end());
    long long k = (i == 1 ? 2 : 1);
    for (long long t = 0; t < g[i].size(); t++) {
      if (g[i][t] != k) {
        break;
      } else {
        k++;
        if (k == i) k++;
      }
    }
    l = i, r = k;
    break;
  }
  a[l] = 1;
  a[r] = 2;
  b[l] = 1;
  b[r] = 1;
  long long k = 3;
  for (long long i = 1; i <= n; i++) {
    if (a[i] == 0)
      cout << k++ << ' ';
    else
      cout << a[i] << ' ';
  }
  cout << '\n';
  k = 3;
  for (long long i = 1; i <= n; i++) {
    if (b[i] == 0)
      cout << k++ << ' ';
    else
      cout << b[i] << ' ';
  }
  cout << '\n';
  return 0;
}
