#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:134217728")
using namespace std;
const long long MOD = 1000000000 + 7;
const long long MAXN = 100000 + 100;
int main() {
  int n;
  cin >> n;
  int m;
  cin >> m;
  set<pair<int, int>> ps;
  for (int i = 0; i < m; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    if (a > b) swap(a, b);
    ps.insert({a, b});
  }
  vector<int> vec;
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      if (!ps.count({i, j})) {
        vec.push_back(i);
        vec.push_back(j);
        for (int k = 1; k <= n; ++k) {
          if (k != i && k != j) {
            vec.push_back(k);
          }
        }
        puts("YES");
        vector<int> perm(n);
        for (int k = 0; k < n; ++k) {
          perm[vec[k] - 1] = k + 1;
        }
        for (int k = 0; k < n; ++k) {
          printf("%d ", perm[k]);
        }
        cout << endl;
        perm[vec[1] - 1] = perm[vec[0] - 1];
        for (int k = 0; k < n; ++k) {
          printf("%d ", perm[k]);
        }
        return 0;
      }
    }
  }
  puts("NO");
  return 0;
}
