#include <bits/stdc++.h>
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const long long MAXN = 1e6;
const double eps = 1e-9;
const long long mod = 1e9 + 7;
using namespace std;
long long b[MAXN], a[MAXN];
set<long long> v[MAXN];
long long n, m;
int main() {
  srand(time(0));
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    long long a, b;
    cin >> a >> b;
    v[a].insert(b);
    v[b].insert(a);
  }
  for (int i = 1; i <= n; ++i)
    if (v[i].size() < n - 1) {
      cout << "YES" << endl;
      b[i] = 1;
      a[i] = 1;
      for (long long j = 1; j <= n; ++j)
        if (i != j) {
          if (v[i].find(j) == v[i].end()) {
            a[j] = 2;
            b[j] = 1;
            break;
          }
        }
      long long now = 3;
      for (int i = 1; i <= n; ++i)
        if (a[i])
          cout << a[i] << " ";
        else
          cout << now++ << " ";
      cout << endl;
      now = 3;
      for (int i = 1; i <= n; ++i)
        if (b[i])
          cout << b[i] << " ";
        else
          cout << now++ << " ";
      cout << endl;
      return 0;
    }
  cout << "NO" << endl;
  return 0;
}
