#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<int> g[100005];
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  if (m == (n * (n - 1) / 2)) {
    cout << "NO";
    exit(0);
  }
  int idx1 = -1, idx2 = -1;
  for (int i = n; i >= 1; i--) {
    vector<int> v(n + 1, 0);
    if (g[i].size() != (n - 1)) {
      for (int j = 0; j < g[i].size(); j++) {
        v[g[i][j]] = 1;
      }
      for (int j = i - 1; j > 0; j--) {
        if (!v[j]) {
          idx1 = i;
          idx2 = j;
          break;
        }
      }
      break;
    }
  }
  vector<int> res1(n + 1, 0);
  vector<int> res2(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    res1[i] = res2[i] = i;
  }
  for (int i = idx2 + 1; i < idx1; i++) {
    swap(res1[i], res1[i + 1]);
    swap(res2[i], res2[i + 1]);
  }
  res2[idx1] = res2[idx2];
  cout << "YES\n";
  for (int i = 1; i <= n; i++) cout << res1[i] << " ";
  cout << endl;
  for (int i = 1; i <= n; i++) cout << res2[i] << " ";
}
