#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<int> ans1(n + 1, 0);
  vector<int> ans2(n + 1, 0);
  set<pair<int, int>> s;
  for (int i = 0; i < k; i++) {
    int x, y;
    cin >> x >> y;
    if (x > y) {
      swap(x, y);
    }
    s.insert({x, y});
  }
  if (k == (n - 1) * n / 2) {
    cout << "NO";
    ;
    return 0;
  }
  for (int x = 1; x <= n; x++) {
    for (int y = x + 1; y <= n; y++) {
      if (s.find({x, y}) == s.end()) {
        ans1[x] = ans2[x] = ans2[y] = 1, ans1[y] = 2;
        k = 3;
        for (int i = 1; i <= n; i++) {
          if (ans1[i] && ans2[i]) continue;
          ans1[i] = ans2[i] = k++;
        }
        cout << "YES" << endl;
        for (int i = 1; i <= n; i++) {
          cout << ans1[i] << " ";
        }
        cout << endl;
        for (int i = 1; i <= n; i++) {
          cout << ans2[i] << " ";
        }
        return 0;
      }
    }
  }
  return 0;
}
