#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007LL;
long long large = 2000000000000000000LL;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int> > adj(n, vector<int>());
  set<pair<int, int> > s;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    if (x > y) swap(x, y);
    s.insert(pair<int, int>(x, y));
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  int u = -1, v = -1;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (s.find(pair<int, int>(i, j)) == s.end()) {
        u = i;
        v = j;
        break;
      }
    }
  }
  if (u == -1) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  vector<vector<int> > adjt(n, vector<int>());
  for (int i = 0; i < n; i++) {
    int f = i;
    if (f == v) f = u;
    for (int j = 0; j < (int)adj[i].size(); j++) {
      int to = adj[i][j];
      if (to == v) to = u;
      adjt[f].push_back(to);
    }
  }
  queue<int> q;
  q.push(u);
  vector<int> dis(n, -1);
  dis[u] = 0;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int j = 0; j < (int)adjt[u].size(); j++) {
      int v = adjt[u][j];
      if (dis[v] == -1) {
        dis[v] = dis[u] + 1;
        q.push(v);
      }
    }
  }
  vector<pair<int, int> > e;
  for (int i = 0; i < n; i++) {
    if (i != v) e.push_back(pair<int, int>(dis[i], i));
  }
  sort(e.begin(), e.end());
  vector<int> a(n, -1);
  for (int i = 0; i < (int)e.size(); i++) a[e[i].second] = n - 2 - i;
  a[v] = n - 1;
  for (int i = 0; i < n; i++) printf("%d ", a[i] + 1);
  printf("\n");
  a[v] = n - 2;
  for (int i = 0; i < n; i++) printf("%d ", a[i] + 1);
  printf("\n");
  return 0;
}
