#include <bits/stdc++.h>
using namespace std;
int n, m;
int p[100005], d[100005];
bool vis[100005];
int head[100005], cnt;
struct edge {
  int to, next;
} e[100005 << 1];
void addedge(int u, int v) {
  e[++cnt].to = v;
  e[cnt].next = head[u];
  head[u] = cnt;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    d[v]++;
    d[u]++;
    addedge(u, v);
    addedge(v, u);
  }
  bool ok = 0;
  for (int i = 1; i <= n; ++i)
    if (d[i] != n - 1) ok = 1;
  if (!ok)
    puts("NO");
  else {
    puts("YES");
    int a = 0, b = 0;
    for (int i = 1; i <= n; ++i) {
      if (d[i] != n - 1) {
        for (int j = head[i]; j; j = e[j].next) {
          int v = e[j].to;
          vis[v] = 1;
        }
        for (int j = 1; j <= n; ++j)
          if (!vis[j] && i != j) {
            a = i;
            b = j;
            break;
          }
        break;
      }
    }
    for (int i = 1; i <= n; ++i) p[i] = i;
    swap(p[a], p[n - 1]);
    swap(p[b], p[n]);
    for (int i = 1; i <= n; ++i) printf("%d ", p[i]);
    puts("");
    p[a] = n;
    for (int i = 1; i <= n; ++i) printf("%d ", p[i]);
    puts("");
  }
  return 0;
}
