#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  std::cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  std::cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
signed main() {
  ios_base::sync_with_stdio(0);
  long long TESTS = 1;
  while (TESTS--) {
    long long n, m;
    cin >> n >> m;
    if (n == 1) {
      cout << "NO";
      return 0;
      ;
    }
    set<long long> g[n + 1];
    for (long long i = 0; i < m; i++) {
      long long a, b;
      cin >> a >> b;
      if (g[a].find(b) != g[a].end()) continue;
      g[a].insert(b);
      g[b].insert(a);
    }
    bool f = 0;
    for (long long i = 1; i < n + 1; i++)
      if ((long long)g[i].size() < n - 1) f = 1;
    if (!f) {
      cout << "NO";
      return 0;
      ;
    }
    long long s1[n + 1], s2[n + 1];
    set<pair<long long, long long>> s;
    for (long long i = 1; i < n + 1; i++) s.insert({(long long)g[i].size(), i});
    long long last = -1, lastind = -1;
    for (long long i = 1; i < n + 1; i++) {
      auto j = *--s.end();
      s.erase(--s.end());
      s1[j.second] = i;
      s2[j.second] = i;
      for (auto k : g[j.second]) {
        s.erase({(long long)g[k].size(), k});
        g[k].erase(j.second);
        s.insert({(long long)g[k].size(), k});
      }
      if (j.first == last) {
        s2[j.second] = s2[lastind];
      }
      last = j.first;
      lastind = j.second;
    }
    cout << "YES" << '\n';
    for (long long i = 1; i < n + 1; i++) cout << s1[i] << " ";
    cout << '\n';
    for (long long i = 1; i < n + 1; i++) cout << s2[i] << " ";
  }
}
