#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, min_elem = 1;
  cin >> n >> m;
  vector<vector<int>> g(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  vector<int> used(n);
  int f = -1;
  for (int i = 0; i < n; i++) {
    if (g[i].size() < n - 1) {
      if (g[i].size() == 0) {
        f = i;
      }
      for (int j = 0; j < g[i].size(); j++) {
        used[g[i][j]] = 1;
        f = i;
      }
      break;
    }
  }
  if (f == -1) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  int v = -1;
  for (int i = 0; i < n; i++) {
    if (used[i] == 0) {
      v = i;
    }
  }
  vector<int> ans(n);
  ans[v] = min_elem;
  ans[f] = min_elem;
  min_elem += 2;
  for (int i = 0; i < n; i++) {
    if (i != v && i != f) {
      ans[i] = min_elem++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i == v)
      cout << ans[i] + 1 << " ";
    else
      cout << ans[i] << " ";
  }
  cout << endl;
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
