#include <bits/stdc++.h>
using namespace std;
int read() {
  char ch = getchar();
  int x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int N = 1e5 + 5;
vector<int> G[N];
int a[N], b[N];
int deg[N];
bool book[N];
int n, m;
int idx;
void dfs(int now) {
  if (a[now]) return;
  a[now] = b[now] = ++idx;
  for (int i = 0; i < int(G[now].size()); i++) {
    int to = G[now][i];
    dfs(to);
  }
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= m; i++) {
    int x = read(), y = read();
    G[x].push_back(y), G[y].push_back(x);
    deg[x]++, deg[y]++;
  }
  if (m == (long long)n * (n - 1) / 2) {
    printf("NO\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (deg[i] == n - 1) continue;
    for (int j = 0; j < int(G[i].size()); j++) {
      book[G[i][j]] = true;
    }
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      if (!book[j]) {
        a[i] = a[j] = 1;
        b[i] = 1, b[j] = 2;
        break;
      }
    }
    idx = 2;
    for (int j = 1; j <= n; j++) {
      if (!a[j]) dfs(j);
    }
    break;
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    printf("%d ", b[i]);
  }
  printf("\n");
  for (int i = 1; i <= n; i++) {
    printf("%d ", a[i]);
  }
  return 0;
}
