#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int MAXN = 1e5 + 3;
int n, m, a[MAXN];
pair<int, int> p;
vector<int> g[MAXN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t1, t2;
  cin >> n >> m;
  for (int i = 0; i < (int)(m); i++) {
    cin >> t1 >> t2;
    g[t1].push_back(t2);
    g[t2].push_back(t1);
  }
  if (n < 2 || m == n * (n - 1) / 2) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  bool f[MAXN];
  for (int i = 1; i <= (int)(n); i++) {
    if (g[i].size() == n - 1) continue;
    memset(f, 0, sizeof(f));
    for (int &j : g[i]) {
      f[j] |= 1;
    }
    for (int j = 1; j <= (int)(n); j++) {
      if (!f[j] && i != j) {
        p = {i, j};
        break;
      }
    }
  }
  a[p.first] = 1;
  a[p.second] = 2;
  int k = 3;
  for (int i = 1; i <= (int)(n); i++) {
    if (!a[i]) {
      a[i] = k++;
    }
    cout << a[i] << " ";
  }
  cout << endl;
  a[p.second] = 1;
  for (int i = 1; i <= (int)(n); i++) {
    cout << a[i] << " ";
  }
  return 0;
}
