#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, first, end, count = 0;
  cin >> n >> m;
  vector<int> a(m + 1, 0);
  for (i = 0; i < n; i++) {
    cin >> first >> end;
    for (j = first; j <= end; j++) a[j] = 1;
  }
  for (i = 1; i < m + 1; i++) {
    if (a[i] == 0) count++;
  }
  cout << count << endl;
  for (i = 1; i < m + 1; i++) {
    if (a[i] == 0) cout << i << " ";
  }
  return 0;
}
