#include <bits/stdc++.h>
using namespace std;
set<long long> adj[100005];
int main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].insert(v);
    adj[v].insert(u);
  }
  long long idx = -1;
  for (long long i = 1; i < n + 1; i++) {
    if (adj[i].size() < n - 1) {
      idx = i;
    }
  }
  if (idx == -1) {
    cout << "NO" << endl;
    return 0;
  }
  long long tmp = -1;
  for (long long i = 1; i < n + 1; i++) {
    if (adj[idx].count(i) == 0) {
      tmp = i;
      break;
    }
  }
  cout << "YES" << endl;
  long long cnt = 3;
  for (long long i = 1; i < n + 1; i++) {
    if (i == idx) {
      cout << 1 << " ";
    } else if (i == tmp) {
      cout << 2 << " ";
    } else {
      cout << cnt++ << " ";
    }
  }
  cout << endl;
  cnt = 3;
  for (long long i = 1; i < n + 1; i++) {
    if (i == tmp || i == idx) {
      cout << 1 << " ";
    } else {
      cout << cnt++ << " ";
    }
  }
  return 0;
}
