#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100100;
int n, m;
vector<int> adl[MAXN];
int ans1[MAXN], ans2[MAXN];
queue<int> Q;
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int l, r;
    scanf("%d %d", &l, &r);
    adl[l].push_back(r);
    adl[r].push_back(l);
  }
  if (n == 1) {
    cout << "NO" << endl;
    return 0;
  }
  if (n * (n - 1) / 2 == m) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  int u, v;
  for (int i = 1; i <= n; i++) {
    if (adl[i].size() != n - 1) {
      u = i;
      set<int> s;
      for (int j = 1; j <= n; j++)
        if (j != i) s.insert(j);
      for (auto it : adl[i]) s.erase(it);
      v = *s.begin();
      break;
    }
  }
  Q.push(u);
  Q.push(v);
  ans2[u] = ans2[v] = 1;
  int cnt = 3;
  while (!Q.empty()) {
    int cv = Q.front();
    Q.pop();
    for (auto it : adl[cv]) {
      if (ans2[it] != 0) continue;
      ans2[it] = cnt++;
    }
  }
  for (int i = 1; i <= n; i++)
    if (ans2[i] == 0) ans2[i] = cnt++;
  for (int i = 1; i <= n; i++) ans1[i] = ans2[i];
  ans1[v] = 2;
  for (int i = 1; i <= n; i++) cout << ans1[i] << " ";
  cout << endl;
  for (int i = 1; i <= n; i++) cout << ans2[i] << " ";
  cout << endl;
  return 0;
}
