#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 7;
bool vis[MAXN];
int n, m, all;
vector<int> edge[MAXN];
int ans1[MAXN], ans2[MAXN];
void ini() {
  all = n;
  for (int i = 1; i <= n; i++) {
    vis[i] = 1;
    edge[i].clear();
  }
}
void solve() {
  if (n == 1 || (m >= (n * (n - 1) / 2))) {
    puts("NO");
    return;
  } else {
    int u, v;
    for (int i = 1; i <= n; i++) {
      int len = edge[i].size();
      if (len != n - 1) {
        u = i;
        for (int j = 1; j <= n; j++) {
          vis[j] = 0;
        }
        vis[u] = 1;
        for (int j = 0; j < len; j++) {
          vis[edge[u][j]] = 1;
        }
        for (int j = 1; j <= n; j++) {
          if (!vis[j]) {
            v = j;
            break;
          }
        }
        break;
      }
    }
    ans1[v] = 1;
    ans1[u] = 2;
    ans2[v] = ans2[u] = 1;
    int cnter = 3;
    for (int i = 1; i <= n; i++) {
      if (i != v && i != u) {
        ans1[i] = ans2[i] = cnter;
        cnter++;
      }
    }
    puts("YES");
    for (int i = 1; i <= n; i++) {
      printf("%d%c", ans1[i], " \n"[i == n]);
    }
    for (int i = 1; i <= n; i++) {
      printf("%d%c", ans2[i], " \n"[i == n]);
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  ini();
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  solve();
}
