#include <bits/stdc++.h>
using namespace std;
set<long long> adj[100003];
int a[100002];
int b[100002];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    adj[x].insert(y);
    adj[y].insert(x);
  }
  if (n == 1 || 2 * m == n * (n - 1)) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    bool ok = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        if (adj[i].find(j) == adj[i].end()) {
          a[i] = 1;
          a[j] = 2;
          b[i] = b[j] = 1;
          int va = 3;
          int vb = 2;
          for (int k = 1; k <= n; k++) {
            if (a[k] == 0) a[k] = va++;
            if (b[k] == 0) b[k] = vb++;
          }
          ok = 1;
          break;
        }
      }
      if (ok) break;
    }
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
    cout << "\n";
    for (int i = 1; i <= n; i++) cout << b[i] << " ";
    cout << "\n";
  }
  return 0;
}
