#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
set<int> s[maxn];
int a[maxn], b[maxn];
int main() {
  int n, m, x, y;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d %d", &x, &y);
    if (x > y) swap(x, y);
    s[x].insert(y);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      if (!s[i].count(j)) {
        a[i] = 1;
        a[j] = 2;
        b[i] = b[j] = 1;
        int cnt = 3;
        for (int k = n; k >= 1; --k)
          if (k != i && k != j) a[k] = b[k] = cnt++;
        puts("YES");
        for (int i = 1; i <= n; ++i)
          printf("%d%s", a[i], (i == n) ? "\n" : " ");
        for (int i = 1; i <= n; ++i)
          printf("%d%s", b[i], (i == n) ? "\n" : " ");
        return 0;
      }
    }
  }
  puts("NO");
}
