#include <bits/stdc++.h>
using namespace std;
int n, m, a, b, p, t;
set<int> s[100010];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a >> b;
    s[a].insert(b);
    s[b].insert(a);
  }
  for (p = 1; p <= n; p++)
    if (s[p].size() < n - 1) break;
  if (p == n + 1) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++)
    if (s[p].find(i) == s[p].end() && p != i) {
      cout << "YES" << endl;
      t = 1;
      for (int j = 1; j <= n; j++)
        if (j == i)
          cout << n - 1 << " ";
        else if (j == p)
          cout << n << " ";
        else
          cout << t++ << " ";
      t = 1;
      cout << endl;
      for (int j = 1; j <= n; j++)
        if (j == i || j == p)
          cout << n << " ";
        else
          cout << t++ << " ";
      cout << endl;
      return 0;
    }
}
