#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> a(n), b(n);
  set<pair<int, int> > s;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    if (x > y) swap(x, y);
    s.insert({x, y});
  }
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++)
      if (!s.count({i, j})) {
        cout << "YES\n";
        int tmp = 0;
        for (int k = 0; k < n; k++) {
          if (k != i && k != j) {
            a[k] = b[k] = ++tmp;
          }
        }
        a[i] = b[i] = tmp + 1;
        a[j] = tmp + 1;
        b[j] = tmp + 2;
        for (int i = 0; i < n; i++) cout << b[i] << ' ';
        cout << '\n';
        for (int i = 0; i < n; i++) cout << a[i] << ' ';
        cout << '\n';
        return 0;
      }
  cout << "NO\n";
  return 0;
}
