#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<vector<int> > v(n + 1);
  for (int i = 0; i < m; i++) {
    int e1, e2;
    scanf("%d%d", &e1, &e2);
    v[min(e1, e2)].push_back(max(e1, e2));
  }
  bool is = false;
  int cur;
  for (int i = 1; i < n; i++) {
    if (v[i].size() < n - i) {
      is = true;
      cur = i;
      break;
    }
  }
  if (is) {
    int *arr = new int[n + 1];
    printf("YES\n");
    bool get[n - cur + 1];
    memset(get, true, sizeof(get));
    for (int j = 0; j < v[cur].size(); j++) {
      get[v[cur][j] - cur] = false;
    }
    int it = -1;
    for (int i = 1; i <= n - cur; i++)
      if (get[i]) {
        it = i + cur;
        break;
      }
    for (int i = 1; i <= cur; i++) arr[i] = i;
    for (int i = it + 1; i <= n; i++) arr[i] = i;
    int fact = 0;
    for (int i = cur + 1; i <= it; i++) arr[i] = it - (fact++);
    for (int i = 1; i <= n; i++) cout << arr[i] << " ";
    cout << endl;
    for (int i = 1; i <= n; i++) {
      if (i == it)
        cout << cur << " ";
      else
        cout << arr[i] << " ";
    }
    cout << endl;
  } else {
    printf("NO\n");
  }
}
