#include <bits/stdc++.h>
using namespace std;
const int N = 1003;
bool vis[N][N];
int dist[N][N];
char s[N][N];
int dy[4] = {1, 0, 0, -1}, dx[4] = {0, -1, 1, 0};
char g[4] = {'D', 'L', 'R', 'U'};
void solve() {
  set<pair<int, int> > s;
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    if (x > y) {
      swap(x, y);
    }
    s.insert(make_pair(x, y));
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      if (!s.count(make_pair(i, j))) {
        int c = 3;
        printf("YES\n");
        for (int k = 1; k <= n; ++k) {
          if (k == i) {
            printf("2 ");
          } else if (k == j) {
            printf("1 ");
          } else {
            printf("%d ", c++);
          }
        }
        c = 3;
        putchar('\n');
        for (int k = 1; k <= n; ++k) {
          if (k == i) {
            printf("1 ");
          } else if (k == j) {
            printf("1 ");
          } else {
            printf("%d ", c++);
          }
        }
        return;
      }
    }
  }
  printf("NO\n");
}
int main() { solve(); }
