#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void in(T &x) {
  x = 0;
  short f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + (c ^ '0'), c = getchar();
  x *= f;
}
template <class T>
inline void out(T x, const char c = '\n') {
  static short st[30];
  short m = 0;
  if (x < 0) putchar('-'), x = -x;
  do st[++m] = x % 10, x /= 10;
  while (x);
  while (m) putchar(st[m--] | '0');
  putchar(c);
}
namespace i207M {
int n, m;
inline void gun() {
  puts("NO");
  exit(0);
}
int p[100005];
map<pair<int, int>, bool> rem;
signed main() {
  in(n), in(m);
  if (n == 1) gun();
  for (register int i = 1, a, b; i <= m; ++i)
    in(a), in(b), rem[make_pair(min(a, b), max(a, b))] = 1;
  int a = -1, b = -1;
  for (register int i = 1; i <= n && a == -1; ++i)
    for (register int j = i + 1; j <= n && a == -1; ++j)
      if (!rem.count(make_pair(i, j))) a = i, b = j;
  if (a == -1) gun();
  puts("YES");
  int cnt = 0;
  for (register int i = 1; i <= n; ++i)
    if (i != a && i != b) p[i] = ++cnt;
  p[a] = ++cnt, p[b] = ++cnt;
  for (register int i = 1; i <= n; ++i) out(p[i], ' ');
  putchar('\n');
  p[b] = p[a];
  for (register int i = 1; i <= n; ++i) out(p[i], ' ');
  return 0;
}
}  // namespace i207M
signed main() {
  i207M::main();
  return 0;
}
