#include <bits/stdc++.h>
using namespace std;
map<int, int> s;
int main() {
  int i, j, t, k, ma, x, n, y, ans;
  scanf("%d%d", &n, &t);
  for (i = 0; i < t; i++) {
    scanf("%d%d", &j, &k);
    if (j > k) {
      s[j * 100001 + k] = 11;
    } else
      s[k * 100001 + j] = 11;
  }
  for (i = 1; i <= n; i++) {
    for (j = i + 1; j <= n; j++) {
      if (s[j * 100001 + i] != 11) {
        printf("YES\n");
        int num = 3;
        for (x = 1; x <= n; x++) {
          if (x == i)
            printf("%d", 1);
          else if (x == j)
            printf("%d", 2);
          else
            printf("%d", num++);
          if (x != n) printf(" ");
        }
        printf("\n");
        num = 3;
        for (x = 1; x <= n; x++) {
          if (x == i)
            printf("%d", 1);
          else if (x == j)
            printf("%d", 1);
          else
            printf("%d", num++);
          if (x != n) printf(" ");
        }
        return 0;
      }
    }
  }
  printf("NO");
  return 0;
  return 0;
}
