#include <bits/stdc++.h>
using namespace std;
int used[2000005];
struct node {
  int id, l, r;
  bool operator<(const node& n) const {
    if (l == n.l) return r - l > n.r - n.l;
    return l < n.l;
  }
} a[200005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    a[i].id = i;
    cin >> a[i].l;
    int x;
    cin >> x;
    a[i].r = a[i].l + x - 1;
  }
  sort(a + 1, a + 1 + m);
  int res = m;
  for (int i = 1; i <= m;) {
    int next = i;
    used[a[i].id] = 1;
    res--;
    int j = i + 1;
    while (j <= m && a[j].l <= a[i].r + 1) {
      if (a[j].r > a[next].r) next = j;
      j++;
    }
    if (next == i) next = j;
    i = next;
  }
  cout << res << '\n';
  ;
  for (int i = 1; i <= m; i++) {
    if (used[i] == 0) cout << i << ' ';
  }
  return 0;
}
