#include <bits/stdc++.h>
using namespace std;
vector<int> a[100010];
int ans[100010];
int main() {
  int n, m, x, y;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    a[x].push_back(y);
    a[y].push_back(x);
  }
  if (n == 1) {
    printf("NO\n");
    return 0;
  }
  x = -1;
  for (int i = 1; i <= n; i++) {
    a[i].push_back(i);
    sort(a[i].begin(), a[i].end());
    if (a[i][0] != 1) x = i, y = 1;
    for (int j = 1; j < a[i].size(); j++)
      if (a[i][j] != a[i][j - 1] + 1) x = i, y = a[i][j - 1] + 1;
  }
  if (x == -1) {
    printf("NO\n");
    return 0;
  }
  int now = 3;
  printf("YES\n");
  for (int i = 1; i <= n; i++)
    if (i != x && i != y) ans[i] = now++;
  ans[x] = 1, ans[y] = 2;
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  printf("\n");
  ans[y] = 1;
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
