#include <bits/stdc++.h>
using namespace std;
const long long INF64 = 1e18 + 1337;
const int INF32 = 1e9 + 228;
const int MOD = 1e9 + 7;
int n, m;
vector<set<int> > g;
int x[100001], y[100001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  g.resize(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].insert(b);
    g[b].insert(a);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      if (!g[i].count(j)) {
        int cnt = 1;
        for (int q = 0; q < n; q++) {
          if (q == i || q == j) continue;
          x[q] = cnt;
          y[q] = cnt;
          cnt++;
        }
        x[i] = cnt;
        x[j] = cnt + 1;
        y[i] = cnt;
        y[j] = cnt;
        cout << "YES\n";
        for (int p = 0; p < n; p++) cout << x[p] << " ";
        cout << "\n";
        for (int p = 0; p < n; p++) cout << y[p] << " ";
        cout << "\n";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
