#include <bits/stdc++.h>
using namespace std;
struct vec2 {
  int x, y, id;
  vec2() : x(0), y(0), id(0) {}
  vec2(int x, int y, int id) : x(x), y(y), id(id) {}
} data[0x100000];
int result[0x100000], rscnt = 0;
bool cmpveca(const vec2& a, const vec2& b) {
  return a.x < b.x || (a.x == b.x && a.y > b.y);
}
bool cmpint(const int& a, const int& b) { return a < b; }
int main() {
  int n;
  scanf("%*d%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &data[i].x, &data[i].y);
    data[i].y += data[i].x - 1;
    data[i].id = i + 1;
  }
  sort(data, data + n, cmpveca);
  int p = 0, q = 0;
  for (int i = 1; i < n; ++i) {
    if (data[i].y <= data[q].y)
      result[rscnt++] = data[i].id;
    else if (data[i].x > data[q].y)
      p = q = i;
    else if (data[i].x > data[p].y + 1) {
      p = q;
      q = i;
    } else {
      if (p != q) result[rscnt++] = data[q].id;
      q = i;
    }
  }
  sort(result, result + rscnt, cmpint);
  printf("%d\n", rscnt);
  for (int i = 0; i < rscnt; ++i)
    printf("%d%c", result[i], i + 1 == rscnt ? '\n' : ' ');
  return 0;
}
