#include <bits/stdc++.h>
using namespace std;
int n, m;
set<int> e[101101];
int a[101101];
int main() {
  scanf("%d%d", &n, &m);
  if (m == 1LL * n * (n - 1) / 2) {
    puts("NO");
    return 0;
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    e[x].insert(y);
    e[y].insert(x);
  }
  int found = -1;
  for (int i = 1; i <= n; i++) {
    if (e[i].size() == n - 1) continue;
    for (int j = 1; j <= n; j++)
      if (j != i && e[i].find(j) == e[i].end()) {
        found = j;
        break;
      }
    a[i] = a[found] = 1;
    int it = 3;
    for (int j = 1; j <= n; j++) {
      if (j == i || j == found) continue;
      a[j] = it;
      it++;
    }
    break;
  }
  puts("YES");
  for (int i = 1; i <= n; i++)
    printf("%d%c", i == found ? 2 : a[i], i < n ? ' ' : '\n');
  for (int i = 1; i <= n; i++) printf("%d%c", a[i], i < n ? ' ' : '\n');
  return 0;
}
