#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> links[100005];
long long ans[100005];
int main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    cin >> links[i].first >> links[i].second;
    if (links[i].first > links[i].second) {
      swap(links[i].first, links[i].second);
    }
  }
  sort(links, links + m);
  long long a = 1, b = 2;
  long long pos = 0;
  for (long long i = 0; i < m; i++) {
    if (links[i].first != a || links[i].second != b) {
      pos = 1;
      break;
    }
    b++;
    if (b > n) {
      a++;
      b = a + 1;
    }
  }
  if (a <= n && b <= n) {
    pos = 1;
  }
  if (!pos) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    ans[a - 1] = 1;
    ans[b - 1] = 2;
    long long k = 3;
    for (long long i = 0; i < n; i++) {
      if (ans[i] == 0) {
        ans[i] = k++;
      }
    }
    for (long long i = 0; i < n; i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
    ans[b - 1] = 1;
    for (long long i = 0; i < n; i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
