#include <bits/stdc++.h>
using namespace std;
long long n, m;
vector<int> graph[1001000];
int a[1001000];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) graph[i].push_back(i);
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  int lowest = 0, lower = 0;
  for (int i = 1; i <= n; i++) {
    if (graph[i].size() < n) {
      sort(graph[i].begin(), graph[i].end());
      for (int j = 1; j <= graph[i].size(); j++) {
        if (graph[i][j - 1] != j) {
          lowest = i, lower = j;
          break;
        }
      }
    }
  }
  if (lowest == 0) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    a[lowest] = 1, a[lower] = 2;
    int counter = 3;
    for (int i = 1; i <= n; i++)
      if (!a[i]) a[i] = counter, counter++;
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
    cout << "\n";
    a[lower] = 1;
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
  }
  return 0;
}
