#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
int aa[N * 2], bb[N * 2], ii[N * 2];
int main() {
  int n, m;
  cin >> m >> n;
  if (n == (long long)m * (m - 1) / 2) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> aa[i] >> bb[i], aa[i]--, bb[i]--;
    ii[i] = i;
    aa[n + i] = bb[i], bb[n + i] = aa[i];
    ii[n + i] = n + i;
  }
  sort(ii, ii + n * 2, [](int i, int j) {
    return aa[i] < aa[j] || aa[i] == aa[j] && bb[i] < bb[j];
  });
  int a = 0, b = 1;
  int i = 0;
  while (i < n * 2 && aa[ii[i]] == a && bb[ii[i]] == b) {
    i++;
    b++;
    if (b == a) b++;
    if (b >= m) a++, b = 0;
  }
  cout << "YES\n";
  int x = 0;
  for (int i = 0; i < m; i++)
    cout << (i == a ? m - 1 : i == b ? m : ++x) << ' ';
  cout << '\n';
  x = 0;
  for (int i = 0; i < m; i++)
    cout << (i == a ? m - 1 : i == b ? m - 1 : ++x) << ' ';
  cout << '\n';
  return 0;
}
