#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long> > al(n, vector<long long>());
  if (2 * m >= (n * (n - 1))) {
    cout << "NO" << endl;
    return 0;
  }
  vector<long long> deg(n, 0);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    al[a].push_back(b);
    al[b].push_back(a);
    deg[a]++;
    deg[b]++;
  }
  int x, y;
  for (int i = 0; i < n; ++i) {
    if (deg[i] < n - 1) {
      x = i;
      vector<long long> vist = vector<long long>(n, 0);
      vist[i] = 1;
      for (int j = 0; j < deg[i]; ++j) {
        vist[al[i][j]] = 1;
      }
      for (int j = 0; j < n; ++j) {
        if (!vist[j]) {
          y = j;
          break;
        }
      }
      break;
    }
  }
  if (y < x) swap(x, y);
  cout << "YES" << endl;
  for (int i = 0; i < n; ++i) {
    if (i <= x) {
      cout << i + 1 << " ";
    } else if (i < y) {
      cout << i + 2 << " ";
    } else if (i > y) {
      cout << i + 1 << " ";
    } else {
      cout << x + 2 << " ";
    }
  }
  cout << endl;
  for (int i = 0; i < n; ++i) {
    if (i <= x) {
      cout << i + 1 << " ";
    } else if (i < y) {
      cout << i + 2 << " ";
    } else if (i > y) {
      cout << i + 1 << " ";
    } else {
      cout << x + 1 << " ";
    }
  }
  cout << endl;
}
