#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> v(m);
  for (int i = 0; i < m; ++i) {
    cin >> v[i].first >> v[i].second;
    v[i].first--, v[i].second--;
    if (v[i].first > v[i].second) swap(v[i].first, v[i].second);
  }
  sort(v.begin(), v.end());
  vector<int> ans1(n), ans2(n);
  int nextNum = 3, l = 0, r = 1;
  for (int i = 0; l + 1 < n; ++i) {
    if (i >= m || v[i].first != l || v[i].second != r) {
      cout << "YES" << endl;
      ans1[l] = ans2[l] = ans2[r] = 1;
      ans1[r] = 2;
      for (int i = 0; i < n; ++i) {
        if (i != l && i != r) {
          ans1[i] = ans2[i] = nextNum;
          nextNum++;
        }
      }
      for (int i : ans1) cout << i << ' ';
      cout << endl;
      for (int i : ans2) cout << i << ' ';
      return 0;
    }
    r++;
    if (r >= n) {
      l++;
      r = l + 1;
    }
  }
  cout << "NO";
}
