#include <bits/stdc++.h>
const int N = 1e5 + 5;
int n, m, a[N], b[N];
std::unordered_set<int> g[N];
int main() {
  scanf("%d%d", &n, &m);
  for (int x, y, i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    if (x > y) std::swap(x, y);
    g[x].insert(y);
    g[y].insert(x);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++)
      if (!g[i].count(j)) {
        printf("YES\n");
        int cnt = 0;
        for (int k = 1; k <= n; k++)
          if (k != i && k != j) a[k] = b[k] = ++cnt;
        b[i] = a[i] = ++cnt;
        a[j] = ++cnt;
        b[j] = b[i];
        for (int k = 1; k <= n; k++) printf("%d%c", a[k], " \n"[k == n]);
        for (int k = 1; k <= n; k++) printf("%d%c", b[k], " \n"[k == n]);
        return 0;
      }
  }
  printf("NO\n");
  return 0;
}
