#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  bool a[m + 1];
  memset(a, 0, sizeof(a));
  for (int i = 1; i <= n; i++) {
    int l, r;
    cin >> l >> r;
    for (int j = l; j <= r; j++) a[j] = 1;
  }
  vector<int> v;
  int res = 0;
  for (int i = 1; i <= m; i++) {
    if (a[i] == 0) {
      res++;
      v.push_back(i);
    }
  }
  cout << res << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
}
