#include <bits/stdc++.h>
using namespace std;
const int N = int(1e9);
vector<set<int>> com;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, x, y;
  cin >> n >> m;
  com.resize(n + 1);
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    com[x].insert(y);
    com[y].insert(x);
  }
  int ind1 = N, ind2 = N;
  for (int i = 1; i < n + 1; i++)
    if (com[i].size() < n - 1) {
      ind1 = i;
      break;
    }
  if (ind1 == N) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 1; i < n + 1; i++) {
    if (ind1 == i) continue;
    if (com[i].find(ind1) == com[i].end()) {
      ind2 = i;
      break;
    }
  }
  int num = 3;
  for (int i = 0; i < n; i++) {
    if (i == ind1 - 1)
      cout << 1 << " ";
    else if (i == ind2 - 1)
      cout << 2 << " ";
    else
      cout << num++ << " ";
  }
  cout << endl;
  num = 3;
  for (int i = 0; i < n; i++) {
    if (i == ind1 - 1)
      cout << 1 << " ";
    else if (i == ind2 - 1)
      cout << 1 << " ";
    else
      cout << num++ << " ";
  }
  cout << endl;
  return 0;
}
