#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<set<int>> cmp(n);
  for (int x, y; m--;) {
    cin >> x >> y;
    cmp[--x].insert(--y);
    cmp[y].insert(x);
  }
  int x = -1, y;
  for (int i = 0; i < n; ++i)
    if (cmp[i].size() != n - 1) {
      for (int j = 0; j < n; ++j)
        if (i != j && cmp[i].find(j) == cmp[i].end()) {
          x = i, y = j;
          break;
        }
      break;
    }
  if (x == -1) {
    cout << "NO\n";
    return 0;
  }
  int id = 0;
  vector<int> a(n);
  for (int i = 0; i < n; ++i)
    if (i != x && i != y) a[i] = ++id;
  a[x] = a[y] = n - 1;
  cout << "YES\n";
  a[y] = n;
  for (auto &i : a) cout << i << " \n"[&i == &a.back()];
  a[y] = n - 1;
  for (auto &i : a) cout << i << " \n"[&i == &a.back()];
  return 0;
}
