#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 111;
int n, m;
vector<vector<int> > v;
int was[MAX], clr[MAX], dd = 1, deg[MAX];
int ans1[MAX], ans2[MAX], cnt[MAX], sz[MAX], comp[MAX];
void dfs(int ver, int cc) {
  was[ver] = 1;
  ++sz[cc];
  comp[ver] = cc;
  for (auto to : v[ver]) {
    if (!was[to]) dfs(to, cc);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  v.resize(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  if (m == n * 1LL * (n - 1) / 2) {
    cout << "NO\n";
    return 0;
  }
  int a, b;
  for (int i = 0; i < n; ++i) {
    if (v[i].size() != n - 1) {
      a = i;
      was[a] = true;
      sort(v[i].begin(), v[i].end());
      for (int j = 0; j < (int)v[i].size(); ++j) {
        was[v[i][j]] = true;
      }
      for (int i = 0; i < n; ++i) {
        if (!was[i]) {
          b = i;
          break;
        }
      }
      break;
    }
  }
  cout << "YES\n";
  int cc = 3;
  for (int i = 0; i < n; ++i) {
    if (i == a)
      cout << 1 << " ";
    else if (i == b)
      cout << 2 << " ";
    else
      cout << cc++ << " ";
  }
  cout << "\n";
  cc = 2;
  for (int i = 0; i < n; ++i) {
    if (i == a || i == b)
      cout << 1 << " ";
    else
      cout << cc++ << " ";
  }
  return 0;
}
