#include <bits/stdc++.h>
#pragma GCC optimize "-O3"
using namespace std;
const long long N = 1e5 + 1;
set<long long> q[N];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  while (m--) {
    long long l, r;
    cin >> l >> r;
    q[l].insert(r);
    q[r].insert(l);
  }
  long long L = 0, R = 0;
  for (long long i = 1; i <= n; ++i) {
    q[i].insert(i);
    if (q[i].size() == n) continue;
    L = i;
    for (long long j = 1; j <= n; ++j)
      if (q[i].find(j) == q[i].end()) {
        R = j;
        break;
      }
    break;
  }
  if (!L) return 0 * puts("NO");
  cout << "YES\n";
  long long tot = 2;
  for (long long i = 1; i <= n; ++i) {
    if (i == L || i == R)
      cout << (i == R) + 1 << " ";
    else
      cout << (++tot) << " ";
  }
  cout << "\n";
  tot = 2;
  for (long long i = 1; i <= n; ++i) {
    if (i == L || i == R)
      cout << "1 ";
    else
      cout << (++tot) << " ";
  }
}
