#include <bits/stdc++.h>
using namespace std;
long long m, n, i, j, k, a, b;
pair<long long, long long> mass[2000005];
map<int, int> mymap[2000001];
int main() {
  cin >> n >> m;
  if (n == 1) {
    cout << "NO";
    return 0;
  }
  if (m >= (n * (n - 1)) / 2) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (i = 0; i < m; i++) {
    cin >> mass[i].first >> mass[i].second;
    mymap[mass[i].first][mass[i].second] = 1;
    mymap[mass[i].second][mass[i].first] = 1;
  }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) {
      if (i == j) continue;
      if (mymap[i][j] == 0) {
        a = i;
        b = j;
        break;
      }
    }
  k = 0;
  for (i = 1; i <= n; i++) {
    if (i == a) {
      k++;
      cout << n - 1 << " ";
    } else if (i == b) {
      k++;
      cout << n << " ";
    } else
      cout << i - k << " ";
  }
  cout << endl;
  k = 0;
  for (i = 1; i <= n; i++) {
    if (i == a) {
      k++;
      cout << n - 1 << " ";
    } else if (i == b) {
      k++;
      cout << n - 1 << " ";
    } else
      cout << i - k << " ";
  }
  return 0;
}
