#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
vector<long long> v[100001];
bool compare(pair<long long, long long> x, pair<long long, long long> y) {
  if (x.first < y.first) return 1;
  if (x.first == y.first and x.second < y.second) return 1;
  return 0;
}
void solve() {
  long long n, m, i;
  cin >> n >> m;
  long long x, y;
  long long a[n + 1], b[n + 1];
  memset(a, 0, sizeof(a));
  vector<pair<int, int> > v;
  long long z = m;
  while (m--) {
    cin >> x >> y;
    if (x > y) swap(x, y);
    v.push_back(make_pair(x, y));
  }
  if (n < 2 or z == ((n * (n - 1)) / 2)) {
    cout << "NO";
    return;
  }
  sort(v.begin(), v.end(), compare);
  x = 1, y = 2;
  for (i = 0; i < v.size(); i++) {
    if (x != y and (v[i].first != x or v[i].second != y)) break;
    if (x == y) i--;
    if (y == n) {
      x++;
      y = x + 1;
    } else
      y++;
  }
  b[x] = 1;
  b[y] = 1;
  a[x] = 1;
  a[y] = 2;
  long long k = 3;
  for (i = 1; i <= n; i++) {
    if (i != x and i != y) {
      a[i] = k;
      b[i] = k;
      k++;
    }
  }
  std::cout << "YES" << '\n';
  for (i = 1; i <= n; i++) cout << a[i] << " ";
  cout << '\n';
  for (i = 1; i <= n; i++) cout << b[i] << " ";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
