#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
const int mod2 = 998244353;
long long exp(long long taban, long long us, long long md) {
  long long carpan = taban % md;
  long long temp = us;
  long long res = 1;
  while (temp) {
    if (temp % 2) res = (res * carpan) % md;
    temp /= 2;
    carpan = (carpan * carpan) % md;
  }
  return res;
}
long long ebob(long long a, long long b) {
  if (!a) return b;
  return ebob(b % a, a);
}
long long ekok(long long a, long long b) { return (a * b) / ebob(a, b); }
long long mul(long long a, long long b, long long md) { return a * b % md; }
const int N = 1e5 + 5;
vector<vector<int>> vec(N);
vector<bool> visited(N);
vector<int> val(N);
int current = 1;
void dfs(int cur) {
  visited[cur] = true;
  for (auto x : vec[cur]) {
    if (!visited[x]) dfs(x);
  }
  val[cur] = current++;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  if (n == 1 || 2 * m == n * (n - 1)) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    vec[a].push_back(b);
    vec[b].push_back(a);
  }
  int bas;
  for (int i = 1; i <= n; i++) {
    if (vec[i].size() != n - 1 && !vec[i].empty()) {
      bas = i;
      break;
    }
  }
  bool vis[N] = {};
  int esit;
  for (auto x : vec[bas]) vis[x] = true;
  for (int i = 1; i <= n; i++) {
    if (i == bas) continue;
    if (!vis[i]) {
      esit = i;
      break;
    }
  }
  visited[esit] = true;
  visited[bas] = true;
  for (int i = 1; i <= n; i++) {
    if (!visited[i]) {
      dfs(i);
    }
  }
  dfs(bas);
  for (int i = 1; i <= n; i++) {
    if (!val[i]) {
      val[i] = current++;
    }
  }
  cout << "YES\n";
  if (m == 0) {
    for (int i = 1; i <= n; i++) cout << i << " ";
    cout << "\n";
    cout << "2 ";
    for (int i = 2; i <= n; i++) cout << i << " ";
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    cout << val[i] << " ";
  }
  cout << "\n";
  val[esit] = val[bas];
  for (int i = 1; i <= n; i++) {
    cout << val[i] << " ";
  }
}
