#include <bits/stdc++.h>
using namespace std;
const int MAX_N = (int)1e5 + 15;
bool isAns = 1;
int n, m;
vector<vector<int>> gr;
vector<int> a, b;
void in() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  gr.resize(n + 5);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    gr[a].push_back(b);
    gr[b].push_back(a);
  }
}
void solution() {
  if (n == 1) {
    isAns = 0;
    return;
  }
  a.resize(n + 1);
  int last = 2;
  int ind = -1;
  for (int i = 1; i <= n; ++i) {
    if (gr[i].size() != n - 1) {
      ind = i;
      a[i] = 1;
      int cur = n;
      for (auto it : gr[i]) {
        a[it] = cur--;
      }
      break;
    }
  }
  if (ind == -1) {
    isAns = 0;
    return;
  }
  for (int i = 1; i <= n; ++i) {
    if (a[i] == 0) {
      a[i] = last++;
    }
  }
  b = a;
  pair<int, int> res = {0, 0};
  int i = ind;
  int L = 1, R = n;
  for (auto it : gr[i]) {
    if (a[i] < a[it])
      R = min(R, a[it] - 1);
    else
      L = max(L, a[it] + 1);
  }
  for (int j = L; j <= R; ++j) {
    if (j != a[i]) {
      res = {i, j};
      break;
    }
  }
  if (res.first == 0) {
    isAns = 0;
  } else {
    b[res.first] = res.second;
  }
}
void out() {
  if (!isAns) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    for (int i = 1; i <= n; ++i) {
      cout << a[i] << " ";
    }
    cout << "\n";
    for (int i = 1; i <= n; ++i) {
      cout << b[i] << " ";
    }
    cout << "\n";
  }
}
int main() {
  in();
  solution();
  out();
  return 0;
}
