#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, i, j, k, a, b, c;
  cin >> n >> m;
  vector<set<int>> s(n + 1);
  for (i = 0; i < m; i++) {
    cin >> a >> b;
    s[a].insert(b);
    s[b].insert(a);
  }
  if (m == n * (n - 1) / 2)
    cout << "NO\n";
  else {
    vector<int> ans(n + 1, -1), ans2(n + 1, -1);
    for (i = 1; i <= n; i++) {
      for (j = i + 1; j <= n; j++) {
        if (s[i].find(j) == s[i].end()) {
          ans[i] = 1;
          ans[j] = 2;
          ans2[i] = 1;
          ans2[j] = 1;
          goto outer;
        }
      }
    }
  outer:;
    c = 3;
    for (i = 1; i <= n; i++) {
      if (ans[i] == -1) {
        ans[i] = c;
        ans2[i] = c;
        c++;
      }
    }
    cout << "YES\n";
    for (i = 1; i <= n; i++) cout << ans[i] << " ";
    cout << "\n";
    for (i = 1; i <= n; i++) cout << ans2[i] << " ";
    cout << "\n";
  }
  return 0;
}
