#include <bits/stdc++.h>
using namespace std;
unsigned long long n, k, ans = 0, a, b, sl = 1, jjj, pr, napr, mmm[100001];
vector<long long> sys[100001];
vector<long long> v;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  if (n == 1 or k >= n * (n - 1) / 2 or (n == 2 and k > 0)) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 0; i < k; i++) {
    cin >> a >> b;
    a--;
    b--;
    mmm[a]++;
    mmm[b]++;
    sys[a].push_back(b);
    sys[b].push_back(a);
  }
  for (long long i = 0; i < n; i++) {
    v.push_back(0);
  }
  bool bbbbbbb = true;
  for (long long i = 0; i < n; i++) {
    if (mmm[i] < (n - 1)) {
      v[i] = 1;
      pr = i;
      long long g = 0;
      for (long long r = 0; r < mmm[i]; r++) {
        v[sys[i][r]] = (g + 3);
        g++;
      }
      jjj = g;
      break;
    }
  }
  for (long long i = 0; i < n; i++) {
    if (v[i] == 0) {
      if (bbbbbbb) {
        v[i] = 2;
        bbbbbbb = false;
      } else {
        v[i] = jjj + 3;
        jjj++;
      }
    }
  }
  cout << "YES\n";
  for (int r = 0; r < n; r++) {
    cout << v[r] << " ";
  }
  cout << "\n";
  for (int r = 0; r < n; r++) {
    if (r == pr) {
      cout << 2 << " ";
    } else {
      cout << v[r] << " ";
    }
  }
  return 0;
  cout << "NO\n";
  return 0;
}
