#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
set<int> s[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  if (n < 2) {
    cout << "NO";
    exit(0);
  }
  vector<pair<int, int>> v;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    v.push_back(make_pair(a, b));
    s[a].insert(b);
    s[b].insert(a);
  }
  int a = -1, b;
  for (int i = 1; i <= n; i++) {
    if (s[i].size() != n - 1) {
      a = i;
      break;
    }
  }
  if (a == -1) {
    cout << "NO";
    exit(0);
  }
  for (int i = 1; i <= n; i++) {
    if (i == a) continue;
    if (s[a].find(i) == s[a].end()) {
      b = i;
      break;
    }
  }
  int num = 3;
  vector<int> ans(n);
  ans[a - 1] = 1;
  ans[b - 1] = 2;
  for (int i = 0; i < n; i++) {
    if (i == a - 1 || i == b - 1) continue;
    ans[i] = num;
    num++;
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  cout << "\n";
  for (int i = 0; i < n; i++) {
    if (i == b - 1)
      cout << 1 << " ";
    else
      cout << ans[i] << " ";
  }
  return 0;
}
