#include <bits/stdc++.h>
using namespace std;
int b[100010], c[100010];
vector<int> a[100010];
int main() {
  int n, m;
  while (cin >> n >> m) {
    int x, y;
    for (int i = 0; i < m; ++i) {
      scanf("%d%d", &x, &y);
      a[x].push_back(y);
      a[y].push_back(x);
    }
    bool l = 0;
    vector<int> v;
    for (int i = 1; i <= n; ++i) {
      if (a[i].size() < n - 1) {
        l = 1;
        a[i].push_back(i);
        sort(a[i].begin(), a[i].end());
        int tmp1 = 0, tmp;
        for (int j = 1; j <= n; ++j) {
          if (j != a[i][j - 1]) {
            tmp = j;
            break;
          }
        }
        b[i - 1] = 1;
        b[tmp - 1] = 2;
        c[i - 1] = c[tmp - 1] = 1;
        for (int j = 3; j <= n; ++j) {
          v.push_back(j);
        }
        break;
      }
    }
    if (l) {
      int tmp = 0;
      for (int i = 0; i < n; ++i) {
        if (b[i] == 0) {
          b[i] = c[i] = v[tmp];
          ++tmp;
        }
      }
      cout << "YES" << endl;
      for (int i = 0; i < n; ++i) cout << b[i] << " ";
      cout << endl;
      for (int i = 0; i < n; ++i) cout << c[i] << " ";
      cout << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
