#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  if (n <= 450 and m == n * (n - 1) / 2) {
    cout << "NO\n";
    return 0;
  }
  vector<set<int>> g(n + 1);
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].insert(v);
    g[v].insert(u);
  }
  int x = -1, y = -1;
  for (int i = 1; i <= n and x == -1; ++i) {
    if ((int)g[i].size() == n - 1) continue;
    for (int j = 1; j <= n and x == -1; ++j) {
      if (i == j) continue;
      if (g[i].find(j) == g[i].end()) tie(x, y) = tie(i, j);
    }
  }
  vector<int> v1, v2;
  int cur = 3;
  for (int i = 1; i <= n; ++i) {
    if (i == x) {
      v1.push_back(1);
      v2.push_back(1);
    } else if (i == y) {
      v1.push_back(2);
      v2.push_back(1);
    } else {
      v2.push_back(cur);
      v1.push_back(cur++);
    }
  }
  cout << "YES\n";
  for (auto x : v1) cout << x << ' ';
  cout << '\n';
  for (auto x : v2) cout << x << ' ';
}
