#include <bits/stdc++.h>
using namespace std;
int a[100010], b[100010];
set<pair<int, int>> s;
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    s.insert({x, y});
    s.insert({y, x});
  }
  if (m >= n * (n - 1) / 2) return cout << "NO", 0;
  memset(a, -1, sizeof a);
  memset(a, -1, sizeof b);
  bool br = 0;
  int x;
  for (int i = 1; i <= n; i++) {
    if (br) break;
    for (int j = 1; j <= n; j++) {
      if (j == i) continue;
      if (br) break;
      if (s.find({i, j}) == s.end()) {
        a[i] = i;
        a[j] = i + 1;
        x = i + 2;
        b[i] = b[j] = i;
        br = 1;
      }
    }
    if (!br) a[i] = b[i] = i;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == -1) {
      a[i] = b[i] = x;
      x++;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i < n + 1; i++) cout << a[i] << " ";
  cout << endl;
  for (int i = 1; i < n + 1; i++) cout << b[i] << " ";
  return 0;
}
