#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.14159265358979323846;
const long long mod = 1e9 + 7;
const long long prost = 37;
const long long N = 6e5 + 500;
const int big = 1e9 + 1;
const long long INF = 1e18 + 1;
long long n, m, a[111111], b[111111];
set<long long> s[111111];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  long long l, r;
  for (int i = 1; i <= m; ++i) {
    cin >> l >> r;
    s[l].insert(r);
    s[r].insert(l);
  }
  if (n * 1LL * (n - 1LL) / 2LL == m) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    long long oval = -1;
    for (int j = 1; j <= n; ++j) {
      if (i == j) continue;
      if (s[i].count(j) == 0) {
        oval = j;
        break;
      }
    }
    if (oval == -1) continue;
    long long cnt = 3;
    cout << "YES" << endl;
    for (int j = 1; j <= n; ++j) {
      if (j == i)
        cout << "1 ";
      else if (j == oval)
        cout << "2 ";
      else {
        cout << cnt << " ";
        cnt++;
      }
    }
    cout << endl;
    cnt = 3;
    for (int j = 1; j <= n; ++j) {
      if (j == i)
        cout << "1 ";
      else if (j == oval)
        cout << "1 ";
      else {
        cout << cnt << " ";
        cnt++;
      }
    }
    cout << endl;
    break;
  }
  return 0;
}
