#include <bits/stdc++.h>
const long long INF = 2 * 1e9;
using namespace std;
map<pair<long long, long long>, bool> used;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  if (n < 2 || m >= (n * (n - 1)) / 2) {
    cout << "NO";
    return 0;
  }
  vector<pair<long long, long long> > cmps;
  for (long long i = 0; i < m; ++i) {
    long long f, t;
    cin >> f >> t;
    if (f > t) swap(f, t);
    used[{f - 1, t - 1}] = true;
  }
  vector<long long> v1(n, 0), v2(n, 0);
  pair<long long, long long> can;
  bool f = false;
  for (long long i = 0; i < n; ++i) {
    for (long long j = i + 1; j < n; ++j) {
      if (!used[{i, j}]) {
        can = {i, j};
        f = true;
        break;
      }
    }
    if (f) break;
  }
  v1[can.first] = 1;
  v1[can.second] = 2;
  v2[can.first] = 1;
  v2[can.second] = 1;
  long long last = 3;
  for (long long i = 0; i < n; ++i) {
    if (i != can.first && i != can.second) {
      v1[i] = last++;
      v2[i] = v1[i];
    }
  }
  cout << "YES\n";
  for (long long i = 0; i < n; ++i) cout << v1[i] << ' ';
  cout << '\n';
  for (long long i = 0; i < n; ++i) cout << v2[i] << ' ';
  return 0;
}
