#include <bits/stdc++.h>
using namespace std;
int A[100001], B[100001];
vector<int> compared_with[100001];
bool finder[100001];
int main() {
  int n, m, i, a, b, mark;
  scanf("%d%d", &n, &m);
  if (m >= (n - 1) * 1LL * n / 2)
    printf("NO");
  else {
    memset(A, 0, sizeof A);
    memset(B, 0, sizeof B);
    for (i = 0; i < m; ++i) {
      scanf("%d%d", &a, &b);
      compared_with[a].push_back(b);
      compared_with[b].push_back(a);
    }
    for (i = 1; i <= n; ++i) {
      compared_with[i].push_back(i);
      if (compared_with[i].size() < n) {
        a = i;
        memset(finder, 0, sizeof finder);
        for (vector<int>::iterator it = compared_with[i].begin();
             it != compared_with[i].end(); ++it)
          finder[*it] = true;
        for (b = 1; b <= n; ++b)
          if (!finder[b]) break;
        A[a] = A[b] = B[a] = n;
        B[b] = n - 1;
        mark = 1;
        for (i = 1; i <= n; ++i)
          if (i != a && i != b) A[i] = B[i] = mark++;
        break;
      }
    }
    printf("YES\n");
    for (i = 1; i <= n; ++i) printf("%d ", B[i]);
    printf("\n");
    for (i = 1; i <= n; ++i) printf("%d ", A[i]);
  }
  return 0;
}
