#include <bits/stdc++.h>
using namespace std;
int n, m, i, sum, p, k, l, j, h, y;
struct aa {
  int r, l, b, t, w, e;
};
aa a[200005], b[200005];
int c[3000005];
bool operator<(const aa &A, const aa &B) {
  if (A.l < B.l) return true;
  if (A.l == B.l && A.r > B.r) return true;
  return false;
}
vector<int> v;
int fill(int a, int b) {
  int g = 0;
  for (int i = a; i <= b; i++)
    if (!c[i]) c[i] = 1, g = 1;
  return g;
}
int main() {
  cin >> m >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i].l >> a[i].r;
    a[i].t = i + 1;
  }
  for (i = 0; i < n; i++) a[i].r += a[i].l - 1;
  sort(a, a + n);
  int e = 0;
  int R = 0;
  for (i = 0, j = 0; i < n;) {
    R = a[i].r;
    y = R;
    e = i;
    c[a[i].t] = 1;
    while (j < n) {
      if (a[j].l > y + 1)
        break;
      else if (a[j].r > R)
        R = a[j].r, e = j;
      j++;
    }
    if (e == i)
      i = j;
    else
      i = e;
  }
  int sizze = 0;
  for (i = 1; i <= n; i++) sizze += 1 - c[i];
  cout << sizze << endl;
  for (i = 1; i <= n; i++)
    if (!c[i]) cout << i << " ";
}
