#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, int> myMap;
int main(void) {
  int N, M;
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    myMap[make_pair(a, b)] = 1;
    myMap[make_pair(b, a)] = 1;
  }
  if (N < 1000 && M + M >= N * (N - 1)) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  mt19937_64 mrand(
      chrono::high_resolution_clock::now().time_since_epoch().count());
  int p, q;
  while (true) {
    p = mrand() % N + 1;
    q = mrand() % N + 1;
    if (p == q) continue;
    if (!myMap[make_pair(p, q)]) break;
  }
  int idx = 0;
  for (int i = 0; i < N; i++) {
    if (i == p - 1)
      cout << N - 1 << " ";
    else if (i == q - 1)
      cout << N << " ";
    else
      cout << ++idx << " ";
  }
  cout << endl;
  idx = 0;
  for (int i = 0; i < N; i++) {
    if (i == p - 1)
      cout << N << " ";
    else if (i == q - 1)
      cout << N << " ";
    else
      cout << ++idx << " ";
  }
  cout << endl;
  return 0;
}
