#include <bits/stdc++.h>
using namespace std;
struct data {
  int l, r, i;
};
bool cmp(data d1, data d2) {
  if (d1.l == d2.l) return d1.r > d2.r;
  return d1.l < d2.l;
}
data d[200005];
bool good[200005];
int N, M;
int main() {
  cin >> N >> M;
  for (int i = 0, _i = (M); i < _i; i++) {
    cin >> d[i].l >> d[i].r;
    d[i].i = i;
    d[i].r += d[i].l;
  }
  sort(d, d + M, cmp);
  good[d[0].i] = true;
  int tot = 1;
  int ind = 0;
  int val = d[0].r;
  while (ind < M) {
    int cur = ind;
    while (ind < M && d[ind].l <= val) {
      if (d[ind].r > d[cur].r) cur = ind;
      ind++;
    }
    if (d[cur].r > val) {
      good[d[cur].i] = true;
      val = d[cur].r;
      tot++;
    }
  }
  cout << M - tot << endl;
  for (int i = 0, _i = (M); i < _i; i++) {
    if (!good[i]) cout << i + 1 << " ";
  }
  cout << endl;
  return 0;
}
