#include <bits/stdc++.h>
using namespace std;
long long int n, m, x, y, A[100005], B[100005], say = 3;
map<pair<long long int, long long int>, long long int> tp;
int main() {
  scanf("%lld %lld", &n, &m);
  if (n < 2) {
    printf("NO\n");
    return 0;
  };
  if (n * (n - 1) / 2 == m) {
    printf("NO\n");
    return 0;
  };
  printf("YES\n");
  for (int i = 1; i <= m; i++) {
    scanf("%lld %lld", &x, &y);
    tp[make_pair(x, y)] = 1;
    tp[make_pair(y, x)] = 1;
  }
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (tp[make_pair(i, j)] == 0) {
        A[i] = 1;
        A[j] = 2;
        B[i] = 1;
        B[j] = 1;
        flag = 1;
        break;
      }
    }
    if (flag == 1) break;
  }
  for (int i = 1; i <= n; i++) {
    if (A[i] == 0) {
      A[i] = say;
      B[i] = say;
      say++;
    }
  }
  for (int i = 1; i <= n; i++) printf("%lld ", A[i]);
  printf("\n");
  for (int i = 1; i <= n; i++) printf("%lld ", B[i]);
  return 0;
}
