#include <bits/stdc++.h>
using namespace std;
constexpr int MAX_N = 100009;
int n, m;
vector<int> a[MAX_N];
int c[MAX_N];
int main() {
  cin >> n >> m;
  if ((int64_t)n * (n - 1) / 2 == m) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    if (x > y) swap(x, y);
    a[y].push_back(x);
  }
  for (int i = 2; i <= n; ++i) {
    if (a[i].size() == i - 1) continue;
    for (int x : a[i]) c[x] = i;
    int j;
    for (j = 1; j < i; ++j) {
      if (c[j] != i) break;
    }
    for (int k = 1; k <= n; ++k) {
      cout << (k == j   ? n - 1
               : k == i ? n
                        : k - (k > i) - (k > j))
           << (k == n ? '\n' : ' ');
    }
    for (int k = 1; k <= n; ++k) {
      cout << (k == j   ? n
               : k == i ? n
                        : k - (k > i) - (k > j))
           << (k == n ? '\n' : ' ');
    }
    return 0;
  }
}
