#include <bits/stdc++.h>
using namespace std;
int n, m, l, r, cnt = 0;
int main() {
  cin >> n >> m;
  int a[m];
  a[0] = 1;
  for (int i = 0; i < n; i++) {
    cin >> l >> r;
    for (int i = l; i <= r; i++) a[i] = 1;
  }
  for (int i = 0; i < m + 1; i++) {
    if (a[i] != 1) cnt++;
  }
  cout << cnt << endl;
  for (int i = 0; i < m + 1; i++) {
    if (a[i] != 1) cout << i << " ";
  }
}
