#include <bits/stdc++.h>
using namespace std;
const int num = 1e5 + 10;
int a[num], b[num];
struct node {
  int u, v;
} e[num];
bool cmp(node &a, node &b) {
  if (a.u == b.u)
    return a.v < b.v;
  else
    return a.u < b.u;
}
int main() {
  long long n, m;
  scanf("%lld%lld", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &e[i].u, &e[i].v);
    if (e[i].v < e[i].u) swap(e[i].u, e[i].v);
  }
  if (2 * m >= (n * (n - 1))) {
    printf("NO");
    return 0;
  }
  sort(e + 1, e + m + 1, cmp);
  int x = 1, y = 2;
  int u = 1, v = 2, c = 0, f = 1;
  for (int i = 1; i < n && f; i++)
    for (int j = i + 1; j <= n && f; j++) {
      if (e[++c].u == i && e[c].v == j)
        continue;
      else {
        x = i;
        y = j;
        f = 0;
        break;
      }
    }
  a[x] = 1;
  a[y] = 2;
  b[x] = b[y] = 1;
  int s = 2;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      a[i] = ++s;
      b[i] = a[i];
    }
  }
  printf("YES\n");
  printf("%d", a[1]);
  for (int i = 2; i <= n; i++) {
    printf(" %d", a[i]);
  }
  printf("\n");
  printf("%d", b[1]);
  for (int i = 2; i <= n; i++) {
    printf(" %d", b[i]);
  }
  return 0;
}
