#include <bits/stdc++.h>
using namespace std;
long long n, m;
vector<long long> v[100010];
long long chk[100010];
long long ans1[100010], ans2[100010];
long long top = 3;
int main() {
  scanf("%lld %lld", &n, &m);
  long long i, j;
  long long xx, yy;
  for (i = 1; i <= m; i++) {
    long long s, e;
    scanf("%lld %lld", &s, &e);
    v[s].push_back(e);
    v[e].push_back(s);
  }
  if (n == 1 || m == n * (n - 1) / 2) {
    puts("NO");
    return 0;
  }
  puts("YES");
  set<long long> S;
  for (i = 1; i <= n; i++) {
    S.insert(i);
  }
  for (i = 1; i <= n; i++) {
    S.erase(i);
    for (j = 0; j < v[i].size(); j++) {
      S.erase(v[i][j]);
    }
    if (!S.empty()) {
      xx = i;
      yy = *(S.begin());
    }
    for (j = 0; j < v[i].size(); j++) {
      S.insert(v[i][j]);
    }
    S.insert(i);
  }
  ans1[xx] = 1;
  ans1[yy] = 2;
  ans2[xx] = 1;
  ans2[yy] = 1;
  for (i = 1; i <= n; i++) {
    if (i != xx && i != yy) {
      ans1[i] = ans2[i] = top++;
    }
  }
  for (i = 1; i <= n; i++) {
    printf("%lld ", ans1[i]);
  }
  puts("");
  for (i = 1; i <= n; i++) {
    printf("%lld ", ans2[i]);
  }
}
