#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y, id;
  bool operator<(const node &b) const { return y < b.y; }
} a[200005];
bool cmp(const node &x, const node &y) {
  return x.x < y.x || x.x == y.x && x.y > y.y;
}
priority_queue<node> Q;
int can[200005], n, m, ans, a1;
int main() {
  scanf("%d%d", &n, &m);
  int l, max = 0;
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &a[i].x, &l), a[i].y = a[i].x + l - 1, a[i].id = i;
    max = ::max(max, a[i].y);
  }
  sort(a + 1, a + 1 + m, cmp);
  Q.push(a[1]);
  can[a[1].id] = 1;
  a1 = 2;
  ans = 1;
  while (Q.top().y < max) {
    int pre = a1, yy = Q.top().y;
    for (; a1 <= m; ++a1)
      if (a[a1].x > yy + 1)
        break;
      else
        Q.push(a[a1]);
    if (pre == a1) {
      ++ans;
      can[a[a1].id] = 1;
      Q.push(a[a1]);
      ++a1;
      continue;
    }
    ++ans;
    can[Q.top().id] = 1;
  }
  ans = 0;
  for (int i = 1; i <= m; ++i)
    if (!can[i]) ++ans;
  printf("%d\n", ans);
  for (int i = 1; i <= m; ++i)
    if (!can[i]) printf("%d ", i);
  return 0;
}
