#include <bits/stdc++.h>
using namespace std;
int read() {
  int nm = 0, f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) nm = nm * 10 + c - '0';
  return nm * f;
}
bool vis[100010];
int be, ed, dft;
vector<int> to[100010];
int n, m;
int a[100010], b[100010];
int main() {
  n = read(), m = read();
  for (int i = 1; i <= m; i++) {
    int vi = read(), vj = read();
    to[vi].push_back(vj);
    to[vj].push_back(vi);
  }
  for (int i = 1; i <= n; i++) {
    if (be) break;
    if (to[i].size() == n - 1) continue;
    for (int j = 0; j < to[i].size(); j++) vis[to[i][j]] = true;
    be = i;
    for (int j = 1; j <= n; j++) {
      if (!vis[j] && j != i) {
        ed = j;
        break;
      }
    }
  }
  if (be == 0) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  dft = 2;
  a[be] = b[be] = b[ed] = 1;
  a[ed] = 2;
  for (int i = 1; i <= n; i++) {
    if (!a[i]) {
      dft++;
      a[i] = b[i] = dft;
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << "\n";
  for (int i = 1; i <= n; i++) cout << b[i] << " ";
  return 0;
}
