#include <bits/stdc++.h>
using namespace std;
long long A = 911382325, B = 972663749, M = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, i, g, j, w, l, r, t, v, m, k, x, y, x1, y1, z1, l1, r1, maxi,
      mini, sum, q, p;
  cin >> n;
  cin >> m;
  vector<pair<long long, long long> > a(m);
  for (i = 0; i < m; i++) {
    cin >> x;
    cin >> y;
    a[i].first = min(x, y);
    a[i].second = max(x, y);
    a[i].first--;
    a[i].second--;
  }
  sort(a.begin(), a.end());
  if (m == n * (n - 1) / 2 || n == 1) {
    cout << "NO" << endl;
  } else {
    x = 0;
    y = 1;
    for (i = 0; i < m; i++) {
      if (a[i].first != x || a[i].second != y) {
        break;
      } else {
        y++;
        if (y == n) {
          x++;
          y = x + 1;
        }
      }
    }
    cout << "YES" << endl;
    vector<long long> b(n);
    w = 3;
    for (i = 0; i < n; i++) {
      if (i != x && i != y) {
        b[i] = w;
        w++;
      }
    }
    b[x] = 1;
    b[y] = 2;
    for (i = 0; i < n; i++) {
      cout << b[i] << " ";
    }
    b[y] = 1;
    cout << endl;
    for (i = 0; i < n; i++) {
      cout << b[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
