#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 5;
int n, m, a[MAX], b[MAX];
set<pair<int, int> > s;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    if (a > b) swap(a, b);
    s.insert({a, b});
  }
  if (n == 1) {
    printf("NO\n");
    return 0;
  }
  int ok = 0, x = 0, y = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      auto it = s.find({i, j});
      if (it == s.end()) {
        x = i, y = j;
        ok = 1;
        break;
      }
    }
    if (ok) break;
  }
  if (!ok) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  a[x] = n;
  a[y] = n - 1;
  b[x] = b[y] = n;
  int c = 0;
  for (int i = 1; i <= n; i++) {
    if (i == x || i == y) continue;
    a[i] = b[i] = ++c;
  }
  for (int i = 1; i <= n; i++) {
    printf("%d", a[i]);
    printf(i == n ? "\n" : " ");
  }
  for (int i = 1; i <= n; i++) {
    printf("%d", b[i]);
    printf(i == n ? "\n" : " ");
  }
  return 0;
}
