#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, m;
vector<int> g[N];
bool vis[N];
int pos, minn;
int a[N], b[N];
int cnt[N];
int main() {
  memset(cnt, 0, sizeof(cnt));
  memset(vis, false, sizeof(vis));
  cin >> n >> m;
  if (n == 1) {
    cout << "NO" << endl;
    return 0;
  }
  if (m == 0) {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) cout << i << " ";
    cout << endl;
    cout << "1 1 ";
    for (int i = 3; i <= n; i++) cout << i << " ";
    return 0;
  }
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    cnt[u]++;
    cnt[v]++;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int minn = cnt[1];
  pos = 1;
  for (int i = 2; i <= n; i++) {
    if (minn > cnt[i]) {
      pos = i;
      minn = cnt[i];
    }
  }
  if (minn >= n - 1) {
    cout << "NO" << endl;
    return 0;
  }
  a[pos] = b[pos] = 1;
  int pos1 = -1;
  vis[pos] = true;
  for (int i = 0; i < g[pos].size(); i++) vis[g[pos][i]] = true;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      pos1 = i;
      a[i] = 2;
      b[i] = 1;
      break;
    }
  int _cnt = 3;
  for (int i = 1; i <= n; i++)
    if (i != pos && i != pos1) {
      a[i] = b[i] = _cnt;
      _cnt++;
    }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << endl;
  for (int i = 1; i <= n; i++) cout << b[i] << " ";
  return 0;
}
