#include <bits/stdc++.h>
using namespace std;
const long long int hell = (long long int)(1e18 + 100LL);
const double pi = acos(-1.0);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t, i, j, k, m, n, x, y;
  t = 1;
  while (t--) {
    long long int flag = 0, K;
    cin >> n >> m;
    vector<vector<long long int> > V(n + 1);
    for (i = 0; i < m; i++) {
      cin >> x >> y;
      V[x].push_back(y);
      V[y].push_back(x);
    }
    if (n == 1) {
      cout << "NO";
      return 0;
    }
    for (i = 1; i <= n; i++) {
      sort((V[i]).begin(), (V[i]).end());
    }
    map<long long int, long long int> mp;
    for (i = 1; i <= n; i++) {
      if (V[i].size() == n - 1) continue;
      flag = 1;
      for (j = 1; j <= n; j++) {
        if (j != i) {
          if (!binary_search((V[i]).begin(), (V[i]).end(), j)) {
            vector<long long int> ar(n + 1, 0);
            ar[i] = 1;
            ar[j] = 2;
            long long int c = 3;
            for (k = 1; k <= n; k++) {
              if (ar[k] == 0) {
                ar[k] = c;
                c++;
              }
            }
            cout << "YES\n";
            for (k = 1; k <= n; k++) {
              cout << ar[k] << " ";
            }
            cout << "\n";
            for (k = 1; k <= n; k++) {
              if (k == i || k == j) {
                cout << "1 ";
              } else {
                cout << ar[k] << " ";
              }
            }
            return 0;
          }
        }
      }
    }
    if (!flag) {
      cout << "NO";
      return 0;
    }
  }
  return 0;
}
