#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const double pi = 3.1415926535897932384626;
const double eln = 2.718284590452353602874;
const int maxn = 100005;
vector<int> g[maxn];
int n, m, ans[maxn];
bool t[maxn];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  int a = -1, b = 0;
  for (int i = 1; i <= n; i++) {
    sort(g[i].begin(), g[i].end());
    if (g[i].size() >= n - 1) continue;
    a = i;
    for (int j = 1; j <= n; j++) t[i] = false;
    for (int j : g[i]) t[j] = true;
    t[i] = true;
    for (int j = 1; j <= n; j++)
      if (!t[j]) {
        b = j;
        break;
      }
    break;
  }
  if (a == -1) {
    puts("NO");
    return 0;
  }
  puts("YES");
  int cnt = 0;
  ans[a] = n - 1;
  ans[b] = n;
  for (int i = 1; i <= n; i++)
    if (ans[i] == 0) ans[i] = ++cnt;
  for (int i = 1; i <= n; i++) printf("%d%c", ans[i], i == n ? '\n' : ' ');
  ans[a] = n;
  for (int i = 1; i <= n; i++) printf("%d%c", ans[i], i == n ? '\n' : ' ');
  return 0;
}
