#include <bits/stdc++.h>
using namespace std;
long long modulo(long long base, long long exponent, long long modulus);
long long choose(long long n, long long k);
long long inverse(long long a, long long m);
void build();
long long ncr(long long n, long long r);
vector<long long> fact(1000010);
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  return a.second < b.second;
}
set<long long> adj[1000010];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  build();
  long long n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long x, y;
    cin >> x >> y;
    adj[x].insert(y);
    adj[y].insert(x);
  }
  long long x1, x2;
  bool flag = false;
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() != n - 1) {
      flag = true;
      x1 = i;
      for (int j = 1; j <= n; j++) {
        if (j != x1 && !adj[x1].count(j)) {
          x2 = j;
          break;
        }
      }
      break;
    }
  }
  if (!flag) {
    cout << "NO" << endl;
    return 0;
  } else {
    cout << "YES" << endl;
  }
  vector<long long> a(n + 1), b(n + 1);
  a[x1] = 1;
  a[x2] = 2;
  b[x1] = 1;
  b[x2] = 1;
  long long ind = 3;
  for (int i = 1; i <= n; i++) {
    if (i != x1 && i != x2) {
      a[i] = ind;
      b[i] = ind++;
    }
  }
  assert(ind == n + 1);
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << endl;
  for (int i = 1; i <= n; i++) cout << b[i] << " ";
  return 0;
}
long long ncr(long long n, long long r) {
  if (r > n || r < 0 || n < 0) return 0;
  long long ans = fact[n];
  long long temp = (fact[n - r] * fact[r]) % 998244353;
  ans = (ans * inverse(temp, 998244353)) % 998244353;
  return ans;
}
void build() {
  fact[0] = 1;
  for (long long i = 1; i < 1000010; i++)
    fact[i] = (fact[i - 1] * i) % 998244353;
}
long long modulo(long long base, long long exponent, long long modulus) {
  if (modulus == 1) return 0;
  long long result = 1;
  base = base % modulus;
  while (exponent > 0) {
    if (exponent % 2 == 1) {
      result = (result * base) % modulus;
    }
    exponent = exponent >> 1;
    base = (base * base) % modulus;
  }
  return result;
}
long long choose(long long n, long long k) {
  if (k == 0) return 1;
  return (n * choose(n - 1, k - 1)) / k;
}
void EE(long long a, long long b, long long &co1, long long &co2) {
  if (a % b == 0) {
    co1 = 0;
    co2 = 1;
    return;
  }
  EE(b, a % b, co1, co2);
  long long temp = co1;
  co1 = co2;
  co2 = temp - co2 * (a / b);
}
long long inverse(long long a, long long m) {
  long long x, y;
  EE(a, m, x, y);
  if (x < 0) x += m;
  return x;
}
