#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = 998244353;
const int N = 100000 + 7;
set<pair<int, int>> st;
int arr1[N], arr2[N];
void construct(int a, int b, int n) {
  arr2[a] = 1;
  arr2[b] = 1;
  arr1[a] = 1;
  arr1[b] = 2;
  int cur = 3;
  for (int i = 1; i <= n; i++) {
    if (i == a || i == b) continue;
    arr1[i] = cur;
    arr2[i] = cur;
    cur++;
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    st.insert({a, b});
    st.insert({b, a});
  }
  bool solved = false;
  for (int i = 1; i <= n; i++) {
    if (solved) break;
    for (int j = i + 1; j <= n; j++) {
      if (st.find({i, j}) == st.end()) {
        solved = true;
        construct(i, j, n);
        break;
      }
    }
  }
  if (!solved)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i = 1; i <= n; i++) cout << arr1[i] << " ";
    cout << "\n";
    for (int i = 1; i <= n; i++) cout << arr2[i] << " ";
    cout << "\n";
  }
  return 0;
}
