#include <bits/stdc++.h>
using namespace std;
vector<int> vec[100004];
vector<pair<int, int> > temp;
int main() {
  int a, b, ans[2][100004], j;
  long long n, m;
  scanf("%lld %lld", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d %d", &a, &b);
    vec[a].push_back(b);
    vec[b].push_back(a);
  }
  if (m == (n * (n - 1) / 2)) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  for (int i = 0; i < n; ++i) ans[1][i + 1] = i + 1;
  for (int i = 1; i <= n; ++i) {
    if (vec[i].size() != n - 1) {
      sort(vec[i].begin(), vec[i].end());
      int cnt = 1;
      for (j = 0; j < vec[i].size(); ++j) {
        if (cnt == i) cnt++;
        if (vec[i][j] != cnt) break;
        cnt++;
      }
      if (i == cnt) cnt++;
      ans[1][cnt] = ans[1][i];
      break;
    }
  }
  for (int i = 1; i <= n; ++i) temp.push_back(make_pair(ans[1][i], i));
  sort(temp.begin(), temp.end());
  int cnt = 1;
  for (int i = 0; i < n; ++i) ans[0][temp[i].second] = cnt++;
  for (int i = 1; i <= n; ++i) printf("%d ", ans[0][i]);
  printf("\n");
  for (int i = 1; i <= n; ++i) printf("%d ", ans[1][i]);
  printf("\n");
  return 0;
}
