#include <bits/stdc++.h>
using namespace std;
int n, m;
map<pair<int, int>, bool> has;
int net[100500], d[100500];
void solve() {
  scanf("%d %d", &n, &m);
  if (m == (n * (n - 1)) >> 1) {
    cout << "NO";
    return;
  }
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    if (a > b) swap(a, b);
    has[make_pair(a, b)] = 1;
  }
  int a = -1, b = -1;
  for (int i = 1; i <= n; i++) {
    if (a != -1) {
      break;
    }
    for (int j = i + 1; j <= n; j++) {
      if (!has.count(make_pair(i, j))) {
        a = i;
        b = j;
        break;
      }
    }
  }
  int res = 0;
  net[a] = ++res;
  net[b] = ++res;
  for (int i = 1; i <= n; ++i) {
    if (i != a && i != b) {
      net[i] = ++res;
    }
  }
  for (int i = 1; i <= n; i++) {
    d[i] = net[i];
  }
  d[b] = d[a];
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    cout << net[i] << ' ';
  }
  cout << '\n';
  for (int i = 1; i <= n; i++) {
    cout << d[i] << ' ';
  }
}
int main() {
  int tt = 1;
  while (tt--) {
    solve();
  }
  return 0;
}
