#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> a(m);
  vector<int> cnt(n);
  for (int i = 0; i < m; ++i) {
    cin >> a[i].first >> a[i].second;
    ++cnt[--a[i].first], ++cnt[--a[i].second];
  }
  if (m >= 1ll * n * (n - 1) / 2) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  int j;
  for (int i = 0; i < n; ++i) {
    if (cnt[i] < n - 1) {
      j = i;
      break;
    }
  }
  set<int> s;
  for (int i = 0; i < n; ++i) {
    if (i != j) {
      s.insert(i);
    }
  }
  for (int i = 0; i < m; ++i) {
    if (a[i].first == j) {
      s.erase(a[i].second);
    }
    if (a[i].second == j) {
      s.erase(a[i].first);
    }
  }
  int k = *s.begin();
  for (int i = 0, ptr = 1; i < n; ++i) {
    if (i) {
      cout << ' ';
    }
    if (i == j) {
      cout << n - 1;
    } else if (i == k) {
      cout << n;
    } else {
      cout << ptr++;
    }
  }
  cout << '\n';
  for (int i = 0, ptr = 1; i < n; ++i) {
    if (i) {
      cout << ' ';
    }
    if (i == j or i == k) {
      cout << n;
    } else {
      cout << ptr++;
    }
  }
  return 0;
}
