#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  set<pair<int, int>> st;
  for (int i = 0; i < M; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    if (a > b) swap(a, b);
    st.insert({a, b});
  }
  int ans[100001][2];
  for (int i = 1; i <= N; i++) {
    for (int j = i + 1; j <= N; j++) {
      if (!st.count({i, j})) {
        ans[i][0] = ans[i][1] = ans[j][1] = 1;
        ans[j][0] = 2;
        int pt = 3;
        for (int k = 1; k <= N; k++)
          if (k != i && k != j) {
            ans[k][0] = ans[k][1] = pt;
            pt++;
          }
        cout << "YES" << endl;
        for (int l = 0; l < 2; l++)
          for (int k = 1; k <= N; k++) cout << ans[k][l] << " \n"[k == N];
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
