#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
vector<int> V[maxn];
int n, m, ans1[maxn], ans2[maxn], cnt;
bool vis[maxn];
int main() {
  cin >> n >> m;
  int x, y;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    if (x > y) swap(x, y);
    V[x].push_back(y);
  }
  x = -1, y = -1;
  for (int i = 1; i <= n; i++) {
    int sz = V[i].size();
    if (sz == n - i) continue;
    for (int j = 0; j < sz; j++) {
      vis[V[i][j]] = 1;
    }
    for (int j = i + 1; j <= n; j++) {
      if (!vis[j]) {
        x = i;
        y = j;
        break;
      }
    }
    break;
  }
  if (x == -1)
    puts("NO");
  else {
    cnt = 3;
    ans1[x] = 1, ans1[y] = 2;
    ans2[x] = ans2[y] = 1;
    for (int i = 1; i <= n; i++) {
      if (i == x || i == y) continue;
      ans1[i] = ans2[i] = cnt;
      cnt++;
    }
    puts("YES");
    for (int i = 1; i <= n; i++) printf("%d ", ans1[i]);
    puts("");
    for (int i = 1; i <= n; i++) printf("%d ", ans2[i]);
  }
  return 0;
}
