#include <bits/stdc++.h>
using namespace std;
long long used[100010];
long long a1[100010];
long long a2[100010];
set<pair<long long, long long>> s;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    a1[i] = a2[i] = i * 2 + 1;
  }
  if (n == 1) {
    cout << "NO" << endl;
    return 0;
  }
  long long x, y;
  for (long long i = 0; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    s.insert({x, y});
    s.insert({y, x});
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < i; j++) {
      if (s.count({i, j}) == 0) {
        a2[i] = 1;
        a2[j] = 1;
        long long t = 1;
        long long x = 3;
        for (long long k = 0; k < n; k++) {
          if (k != i && k != j) {
            a1[k] = x;
            a2[k] = x;
            x++;
          } else {
            a1[k] = t;
            t++;
          }
        }
        cout << "YES" << endl;
        for (long long i = 0; i < n; i++) {
          cout << a1[i] << " ";
        }
        cout << endl;
        for (long long i = 0; i < n; i++) {
          cout << a2[i] << " ";
        }
        cout << endl;
        exit(0);
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
