#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int a, b, num;
} instruction;
instruction is[200000];
int cmp(instruction i1, instruction i2) {
  if (i1.a != i2.a)
    return i1.a < i2.a;
  else
    return i1.b < i2.b;
}
int main() {
  int n, m;
  int i, j;
  int ai, li;
  while (scanf("%d%d", &n, &m) != EOF) {
    for (i = 0; i < m; i++) {
      scanf("%d%d", &ai, &li);
      is[i].a = ai;
      is[i].b = ai + li - 1;
      is[i].num = i + 1;
    }
    sort(is, is + m, cmp);
    vector<int> v;
    instruction in = is[0];
    for (i = 1; i < m; i++) {
      if (is[i].a < in.a && is[i].b <= in.b)
        v.push_back(is[i].num);
      else if (is[i].a < in.a && is[i].b > in.b) {
        v.push_back(in.num);
        in.b = is[i].b;
        in.num = is[i].num;
      } else if (is[i].a == in.a && is[i].b <= in.b)
        v.push_back(is[i].num);
      else if (is[i].a == in.a && is[i].b > in.b) {
        v.push_back(in.num);
        in = is[i];
      } else if (is[i].a > in.a && is[i].b <= in.b)
        v.push_back(is[i].num);
      else if (is[i].a > in.a && is[i].b > in.b) {
        if (is[i].a <= in.b) {
          in.a = in.b + 1;
          in.b = is[i].b;
          in.num = is[i].num;
        } else
          in = is[i];
      }
    }
    sort(v.begin(), v.end());
    int len = v.size();
    printf("%d\n", len);
    for (i = 0; i < len; i++) printf("%d%c", v[i], i + 1 == len ? '\n' : ' ');
  }
  return 0;
}
