#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > e;
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int _ = 0, ThxDem = m; _ < ThxDem; ++_) {
    int x, y;
    scanf("%d%d", &x, &y);
    x--;
    y--;
    if (x > y) swap(x, y);
    e.insert(make_pair(x, y));
  }
  if (m == n * (n - 1) / 2) {
    puts("NO");
    return 0;
  }
  int a = -1, b = -1;
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    for (int j = i + 1, ThxDem = n; j < ThxDem; ++j)
      if (!e.count(make_pair(i, j))) {
        a = i;
        b = j;
        break;
      }
    if (a >= 0) break;
  }
  assert(a >= 0);
  puts("YES");
  int t = 1;
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    if (i) putchar(' ');
    if (i == a)
      printf("%d", n - 1);
    else if (i == b)
      printf("%d", n);
    else
      printf("%d", t++);
  }
  puts("");
  t = 1;
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) {
    if (i) putchar(' ');
    if (i == a || i == b)
      printf("%d", n);
    else
      printf("%d", t++);
  }
  puts("");
  return 0;
}
