#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (n == 1) {
    cout << "NO\n";
    return 0;
  }
  vector<set<int> > nums(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    nums[a].insert(b);
    nums[b].insert(a);
  }
  int one, two;
  one = two = -1;
  for (int i = 0; i < n; i++) {
    bool ok = 0;
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      if (!nums[i].count(j)) {
        one = i, two = j;
        ok = 1;
        break;
      }
    }
    if (ok) break;
  }
  if (one == -1 && two == -1) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  if (one > two) swap(one, two);
  vector<int> ans(n);
  ans[one] = n;
  ans[two] = n - 1;
  int num = 1;
  for (int i = 0; i < n; i++) {
    if (i != one && i != two) ans[i] = num, num++;
  }
  for (auto x : ans) cout << x << ' ';
  cout << '\n';
  ans[one] = n - 1;
  for (auto x : ans) cout << x << ' ';
  return 0;
}
