#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int v[MAXN];
map<pair<int, int>, bool> viz;
int main() {
  int p1 = -1, p2 = -1;
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    pair<int, int> x;
    cin >> x.first >> x.second;
    if (x.first > x.second) swap(x.first, x.second);
    viz[x] = true;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      if (!viz[make_pair(i, j)]) {
        p1 = i;
        p2 = j;
        goto stop;
      }
    }
  }
stop:;
  if (p1 == -1) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  int cur = 3;
  v[p1] = 1;
  v[p2] = 2;
  for (int i = 1; i <= n; ++i) {
    if (i == p1 || i == p2) continue;
    v[i] = cur++;
  }
  for (int i = 1; i <= n; ++i) {
    cout << v[i] << ' ';
  }
  cout << '\n';
  v[p2] = 1;
  for (int i = 1; i <= n; ++i) {
    cout << v[i] << ' ';
  }
}
