#include <bits/stdc++.h>
using namespace std;
const int M = 100;
int dd[M + 1 + 1];
int main() {
  int n, m;
  cin >> n >> m;
  while (n--) {
    int l, r;
    cin >> l >> r;
    dd[l]++, dd[r + 1]--;
  }
  for (int i = 2; i <= m; i++) dd[i] += dd[i - 1];
  int cnt = 0;
  for (int i = 1; i <= m; i++)
    if (dd[i] == 0) cnt++;
  cout << cnt << '\n';
  for (int i = 1; i <= m; i++)
    if (dd[i] == 0) cout << i << ' ';
  cout << '\n';
  return 0;
}
