#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const double PI = 3.14159265359;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  if (m == (long long)n * (n - 1) / 2) {
    cout << "NO";
    return 0;
  }
  vector<vector<int>> v(n + 1);
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int x = -1, y = -1;
  for (int i = 1; i <= n; i++) {
    if (v[i].size() < n - 1) {
      x = i;
      sort(v[i].begin(), v[i].end());
      for (int j = 1; j <= n; j++) {
        if (j != i && !binary_search(v[i].begin(), v[i].end(), j)) {
          y = j;
          break;
        }
      }
      break;
    }
  }
  cout << "YES\n";
  vector<int> ans1(n + 1, -1);
  ans1[x] = 1;
  ans1[y] = 2;
  int cur = 3;
  for (int i = 1; i <= n; i++) {
    if (ans1[i] == -1) ans1[i] = cur++;
  }
  auto ans2 = ans1;
  ans2[y] = 1;
  for (int i = 1; i <= n; i++) {
    cout << ans1[i] << ' ';
  }
  cout << '\n';
  for (int i = 1; i <= n; i++) {
    cout << ans2[i] << ' ';
  }
  return 0;
}
