#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long double eps = 0.00000001;
const long long MOD = 998244353;
int32_t main() {
  ios_base::sync_with_stdio(NULL);
  srand(22);
  cout << fixed << setprecision(10);
  long long n, m;
  cin >> n >> m;
  vector<long long> c(n + 1, 0);
  c[0] = n - 1;
  map<long long, set<long long>> p;
  long long lol, kek;
  for (long long i = 0; i < m; ++i) {
    cin >> lol >> kek;
    p[lol].insert(kek);
    p[kek].insert(lol);
    c[lol] += 1;
    c[kek] += 1;
  }
  if (n == 1 || m == n * (n - 1) / 2) {
    cout << "NO" << endl;
    return 0;
  }
  long long pos1 = 0, pos2 = 0;
  for (long long i = 0; i <= n; ++i) {
    if (c[i] == n - 1) continue;
    for (long long j = 0; j <= n; ++j) {
      if (c[j] == n - 1 || i == j) continue;
      if (p[i].count(j) == 0) {
        pos1 = i;
        pos2 = j;
        break;
      }
    }
  }
  cout << "YES" << endl;
  long long l = 3;
  for (long long i = 1; i <= n; ++i) {
    if (i != pos1 && i != pos2)
      cout << l++ << " ";
    else if (i == pos1)
      cout << 1 << " ";
    else
      cout << 2 << " ";
  }
  cout << endl;
  l = 3;
  for (long long i = 1; i <= n; ++i) {
    if (i != pos1 && i != pos2)
      cout << l++ << " ";
    else if (i == pos1)
      cout << 1 << " ";
    else
      cout << 1 << " ";
  }
  cout << endl;
  return 0;
}
