#include <bits/stdc++.h>
using namespace std;
struct str {
  int st, len, id;
};
str jilu[200050];
bool ok[200050];
bool cmp(str a, str b) {
  if (a.st != b.st) return a.st < b.st;
  if (a.len != b.len) return a.len > b.len;
  return a.id < b.id;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &jilu[i].st, &jilu[i].len);
    jilu[i].id = i;
  }
  sort(jilu, jilu + m, cmp);
  int ss = 0;
  int mmaxid = -1, mmax;
  for (int i = 0; i < m; i++) {
    if (jilu[i].st > ss) {
      if (mmaxid != -1) {
        ok[mmaxid] = 1;
        ss = mmax;
        mmaxid = -1;
        i--;
      } else {
        mmaxid = -1;
        ok[jilu[i].id] = 1;
        ss = jilu[i].st + jilu[i].len;
        mmax = ss;
      }
    } else if (jilu[i].st + jilu[i].len > mmax) {
      mmax = jilu[i].st + jilu[i].len;
      mmaxid = jilu[i].id;
    }
  }
  if (mmaxid != -1) ok[mmaxid] = 1;
  int ans = 0;
  for (int i = 0; i < m; i++) {
    ans += ok[i] == 0;
  }
  printf("%d\n", ans);
  for (int i = 0; i < m; i++) {
    if (ok[i] == 0) printf("%d ", i + 1);
  }
}
