#include <bits/stdc++.h>
using namespace std;
struct Line {
  int x, y, d;
} d[200005];
bool f[200005];
bool operator<(const Line &x, const Line &y) {
  return x.x == y.x ? x.y > y.y : x.x < y.x;
}
int main() {
  int n, m, q, t, i, T, ans;
  scanf("%d%d", &m, &n);
  for (i = 1; i <= n; i++)
    scanf("%d%d", &d[i].x, &d[i].y), d[i].y += d[i].x, d[i].d = i;
  sort(d + 1, d + 1 + n);
  ans = n;
  for (q = t = 1; q <= n;) {
    T = d[q].y;
    f[d[q].d] = 1;
    ans--;
    while (t <= n && T >= d[t].x)
      if (d[t++].y > d[q].y) q = t - 1;
    if (d[q].y == T) q = t;
  }
  printf("%d\n", ans);
  for (i = 1; i <= n; i++)
    if (!f[i]) printf("%d ", i);
  puts("");
}
