#include <bits/stdc++.h>
using namespace std;
const int maxx = 1000000 * 2 + 10;
struct Node {
  int a, l;
  int num;
} op[maxx];
int use[maxx];
bool cmp(Node a, Node b) {
  if (a.a != b.a)
    return a.a < b.a;
  else if (a.a == b.a)
    return a.l > b.l;
  return a.num < b.num;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &op[i].a, &op[i].l);
    op[i].num = i + 1;
  }
  sort(op, op + m, cmp);
  int right = op[0].a + op[0].l;
  use[op[0].num] = 1;
  int incl = right;
  int preid = 0;
  int ans = 1;
  for (int i = 1; i < m; i++) {
    if (op[i].a > incl) {
      if (preid) {
        use[preid] = 1;
        incl = right;
        preid = 0;
        i--;
        ans++;
      } else {
        preid = 0;
        use[op[i].num] = 1;
        right = op[i].a + op[i].l;
        incl = right;
        ans++;
      }
    } else if (op[i].a + op[i].l > right) {
      right = op[i].a + op[i].l;
      preid = op[i].num;
    }
  }
  if (preid) {
    ans++;
    use[preid] = 1;
  }
  printf("%d\n", m - ans);
  if (m - ans)
    for (int i = 1; i <= m; i++)
      if (!use[i]) printf("%d ", i);
  return 0;
}
