#include <bits/stdc++.h>
using namespace std;
const int maxe = 100000 + 5;
const int maxv = 5000 + 5;
const int mod = 1000000;
const int maxn = 2 * 1e5 + 5;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
int n, m, d, e;
long long t;
vector<int> a[maxn];
bool vis[maxn];
int main() {
  cin >> n >> m;
  if (n == 1)
    cout << "NO\n";
  else if (n == 2 && m != 0)
    cout << "NO\n";
  else if (n == 2 && m == 0) {
    cout << "YES\n";
    cout << 1 << " " << 2 << endl;
    cout << 1 << " " << 1 << endl;
    return 0;
  } else {
    for (int i = 1; i <= m; i++) {
      cin >> d >> e;
      a[d].push_back(e);
      a[e].push_back(d);
    }
    int tp1 = -1;
    for (int i = 1; i <= n; i++) {
      if (a[i].size() < n - 1) {
        vis[i] = 1;
        tp1 = i;
        for (int j = 0; j < a[i].size(); j++) {
          vis[a[i][j]] = 1;
        }
        break;
      }
    }
    int tp = -1;
    for (int i = 1; i <= n; i++) {
      if (!vis[i]) {
        tp = i;
        break;
      }
    }
    if (tp == -1 || tp1 == -1) {
      cout << "NO\n";
      return 0;
    }
    int flag = 0;
    int cnt = 3;
    cout << "YES\n";
    for (int i = 1; i <= n; i++) {
      if (flag) cout << " ";
      if (i == tp1)
        cout << 1;
      else if (i == tp)
        cout << 2;
      else
        cout << cnt++;
      flag = 1;
    }
    cout << endl;
    cnt = 3;
    flag = 0;
    for (int i = 1; i <= n; i++) {
      if (flag) cout << " ";
      if (i == tp1)
        cout << 1;
      else if (i == tp)
        cout << 1;
      else
        cout << cnt++;
      flag = 1;
    }
    cout << endl;
  }
  return 0;
}
