#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  bool res = false;
  pair<int, int> equal = {-1, -1};
  if (n > 1) {
    set<pair<int, int> > pairs;
    for (int i = int(0); i < int(m); i++) {
      int a, b;
      cin >> a >> b;
      pairs.emplace(a, b);
      pairs.emplace(b, a);
    }
    auto it = pairs.begin();
    for (int i = 1; !res && i < n + 1; i++) {
      for (int j = 1; !res && j < n + 1; j++) {
        if (i == j) continue;
        if (it == pairs.end() || (*it) != (pair<int, int>){i, j}) {
          equal = {i - 1, j - 1};
          res = true;
        }
        if (it != pairs.end()) it++;
      }
    }
  }
  false && cerr << '\n';
  if (!res) {
    cout << "NO" << '\n';
  } else {
    cout << "YES" << '\n';
    false && cerr << 1 + equal.first << " " << 1 + equal.second << '\n';
    int val = 3;
    for (int i = int(0); i < int(n); i++) {
      if (i) cout << ' ';
      if (i == equal.first)
        cout << 1;
      else if (i == equal.second)
        cout << 2;
      else
        cout << val++;
    }
    cout << '\n';
    val = 3;
    for (int i = int(0); i < int(n); i++) {
      if (i) cout << ' ';
      if (i == equal.first || i == equal.second)
        cout << 1;
      else
        cout << val++;
    }
    cout << '\n';
  }
  return 0;
}
