#include <bits/stdc++.h>
using namespace std;
inline void read(long long &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
inline void write(long long x) {
  static const long long maxlen = 100;
  static char s[maxlen];
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (!x) {
    putchar('0');
    return;
  }
  long long len = 0;
  for (; x; x /= 10) s[len++] = x % 10 + '0';
  for (long long i = len - 1; i >= 0; --i) putchar(s[i]);
}
inline void read(int &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
inline void write(int x) {
  static const long long maxlen = 100;
  static char s[maxlen];
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (!x) {
    putchar('0');
    return;
  }
  long long len = 0;
  for (; x; x /= 10) s[len++] = x % 10 + '0';
  for (long long i = len - 1; i >= 0; --i) putchar(s[i]);
}
const int MAXN = 100010;
int n, m;
set<pair<int, int> > S;
int a[MAXN];
int b[MAXN];
int main() {
  read(n);
  read(m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    read(x);
    read(y);
    if (x > y) swap(x, y);
    S.insert(make_pair(x, y));
  }
  bool flag = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++)
      if (S.count(make_pair(i, j)) == 0) {
        a[i] = 1;
        a[j] = 2;
        b[i] = 1;
        b[j] = 1;
        flag = 1;
        break;
      }
    if (flag) break;
  }
  if (flag) {
    puts("YES");
    int cnt;
    cnt = 3;
    for (int i = 1; i <= n; i++) {
      if (a[i] == 0)
        printf("%d", cnt++);
      else
        printf("%d", a[i]);
      if (i != n) printf(" ");
    }
    puts("");
    cnt = 3;
    for (int i = 1; i <= n; i++) {
      if (b[i] == 0)
        printf("%d", cnt++);
      else
        printf("%d", b[i]);
      if (i != n) printf(" ");
    }
    puts("");
  } else
    puts("NO");
  return 0;
}
