#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 15;
int n, m, a[N];
vector<int> g[N];
pair<int, int> get() {
  for (int i = 0; i < n; i++) {
    if (g[i].size() < n - 1) {
      set<int> s;
      for (int j : g[i]) s.insert(j);
      s.insert(i);
      for (int j = 0; j < n; j++)
        if (!s.count(j)) return {i, j};
    }
  }
  return {-1, -1};
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  pair<int, int> x = get();
  if (x.first < 0) return !(cout << "NO" << endl);
  for (int i = 0; i < n; i++) a[i] = i + 1;
  swap(a[1], a[x.second]);
  swap(a[0], a[x.first]);
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
  a[x.second] = 1;
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
}
