#include <bits/stdc++.h>
using namespace std;
void fileio() {}
vector<vector<long long int>> g;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  fileio();
  long long int n, m;
  cin >> n >> m;
  if (m >= n * (n - 1) / 2) {
    cout << "NO";
    return 0;
  }
  vector<long long int> a(n, 0), b(n, 0);
  for (long long int i = 0; i < n; i++) a[i] = b[i] = i + 1;
  set<pair<long long int, long long int>> s;
  for (long long int i = 0; i < m; i++) {
    long long int x, y;
    cin >> x >> y;
    s.insert({min(x, y), max(x, y)});
  }
  cout << "YES";
  cout << '\n';
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = i + 1; j <= n; j++) {
      if (!s.count({i, j})) {
        long long int toti = 1;
        for (long long int k = 1; k <= n; k++) {
          if (k == i or k == j) continue;
          a[k - 1] = toti;
          b[k - 1] = toti;
          toti++;
        }
        a[i - 1] = toti;
        a[j - 1] = toti + 1;
        b[i - 1] = toti;
        b[j - 1] = toti;
        for (auto it : a) cout << it << " ";
        cout << '\n';
        for (auto it : b) cout << it << " ";
        return 0;
      }
    }
  }
  return 0;
}
