#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 15;
const int inf = 0x3f3f3f3f;
int ans[2][N];
inline pair<int, int> getPr(set<pair<int, int> >& st, int n) {
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (!st.count(make_pair(i, j))) {
        return make_pair(i, j);
      }
    }
  }
  return make_pair(-1, -1);
}
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    memset(ans, 0, sizeof(ans));
    set<pair<int, int> > st;
    for (int i = 1; i <= m; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      st.insert(make_pair(u, v));
      st.insert(make_pair(v, u));
    }
    if (m >= 1LL * n * (n - 1) / 2) {
      puts("NO");
      continue;
    }
    pair<int, int> pr = getPr(st, n);
    ans[0][pr.first] = 1, ans[0][pr.second] = 2;
    ans[1][pr.first] = ans[1][pr.second] = 1;
    for (int i = 1, j = 3; i <= n; i++) {
      if (!ans[0][i]) {
        ans[0][i] = ans[1][i] = j++;
      }
    }
    puts("YES");
    for (int k = 0; k < 2; k++) {
      for (int i = 1; i <= n; i++) {
        printf("%d ", ans[k][i]);
      }
      puts("");
    }
  }
}
