#include <bits/stdc++.h>
using namespace std;
template <class T>
using V = vector<T>;
const long long MOD = 1e9 + 7, INF = 9e18;
const int inf = 2e9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  V<set<int> > s(n + 1);
  V<int> a1(n + 1), a2(n + 1);
  while (m--) {
    int a, b;
    cin >> a >> b;
    s[a].insert(b);
    s[b].insert(a);
  }
  int x = -1, y = -1;
  for (int i = 1; i <= n; i++)
    if ((int)s[i].size() < (n - 1)) {
      x = i;
      break;
    }
  if (x == -1) {
    cout << "NO";
    return 0;
  }
  for (int i = 1; i <= n; i++)
    if (i != x && s[x].find(i) == s[x].end()) {
      y = i;
      break;
    }
  a1[x] = 1;
  a1[y] = 2;
  a2[x] = 1;
  a2[y] = 1;
  int cnt = 3;
  for (int i = 1; i <= n; i++)
    if (i != x && i != y) {
      a1[i] = cnt;
      a2[i] = cnt;
      cnt++;
    }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    cout << a1[i] << " ";
  }
  cout << "\n";
  for (int i = 1; i <= n; i++) {
    cout << a2[i] << " ";
  }
  return 0;
}
