#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const long long mod = 998244353;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-7;
inline long long read() {
  long long X = 0, w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
long long n, m, a, b;
vector<int> vec[maxn], v;
long long cnt[maxn], arr1[maxn], arr2[maxn], cnt1[maxn];
int main() {
  n = read(), m = read();
  for (int i = 1; i <= m; ++i) {
    int u = read(), v = read();
    vec[u].push_back(v);
    vec[v].push_back(u);
  }
  if (2 * m >= n * (n - 1)) {
    cout << "NO" << endl;
    return 0;
  }
  int anspos;
  for (int i = 1; i <= n; ++i) {
    if (vec[i].size() == n - 1)
      continue;
    else {
      anspos = i;
      for (int j = 0; j < vec[i].size(); ++j) cnt[vec[i][j]] = 1;
      break;
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (cnt[i] == 0 && i != anspos) {
      arr2[anspos] = arr2[i] = n;
      arr1[anspos] = n, arr1[i] = n - 1;
      break;
    }
  }
  int res = 0;
  for (int i = 1; i <= n; ++i) {
    if (arr1[i] == 0) arr1[i] = ++res;
  }
  res = 0;
  for (int i = 1; i <= n; ++i) {
    if (arr2[i] == 0) arr2[i] = ++res;
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; ++i) {
    cout << arr1[i];
    if (i == n)
      cout << endl;
    else
      cout << " ";
  }
  for (int i = 1; i <= n; ++i) {
    cout << arr2[i];
    if (i == n) cout << endl;
    cout << " ";
  }
}
