#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> num(m + 1, true);
  while (n--) {
    int l, r;
    cin >> l >> r;
    for (int i = l; i <= r; ++i) num[i] = false;
  }
  int size = count(num.begin() + 1, num.end(), true);
  cout << size << endl;
  for (int i = 1; i <= m; ++i) {
    if (num[i]) cout << i << " ";
  }
}
