#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long long MAX = (long long)2e6 + 100;
long long inf = (long long)1e18;
long long mod = (long long)1e13 + 2987429;
long long n, m, ans[MAX], b[MAX];
set<long long> gr[MAX];
void solve() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    gr[a].insert(b);
    gr[b].insert(a);
  }
  long long ok = 0;
  for (int i = 1; i <= n; i++) {
    if (gr[i].size() != n - 1) {
      ok = 1;
      ans[i] = n;
      b[i] = n;
      for (int j = 1; j <= n; j++) {
        if (j != i && gr[i].count(j) == 0) {
          ans[j] = n;
          b[j] = n - 1;
          break;
        }
      }
      break;
    }
  }
  if (ok == 0) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  long long cur = n - 1;
  for (int i = 1; i <= n; i++) {
    if (ans[i] == 0) {
      ans[i] = cur;
      b[i] = cur - 1;
      cur--;
    }
  }
  for (int i = 1; i <= n; i++) cout << b[i] << " ";
  cout << "\n";
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
}
int main() {
  mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
  long long q;
  ios::sync_with_stdio(0);
  q = 1;
  while (q--) solve();
  return 0;
}
