#include <bits/stdc++.h>
using namespace std;
struct st {
  int i;
  int a;
  int a2;
  int l;
  static bool lessLength(const st& stl, const st& str) { return stl.l < str.l; }
  static bool moreLength(const st& stl, const st& str) { return stl.l > str.l; }
  static bool startFastAndMoreLength(const st& stl, const st& str) {
    return (stl.a == str.a) ? (stl.l > str.l) : (stl.a <= str.a);
  }
};
int main() {
  int MAXROW = 2 * 100000;
  int n, m;
  cin >> n >> m;
  st* s = new st[m];
  int ai, li, a2i;
  for (int i = 0; i < m; ++i) {
    cin >> ai >> li;
    a2i = ai + li;
    s[i].i = i;
    s[i].a = ai;
    s[i].a2 = a2i;
    s[i].l = li;
  }
  sort(s, s + m, st::startFastAndMoreLength);
  int optimized = 0;
  int* r = new int[m];
  int end = 0;
  for (int i = 0; i < m; ++i) {
    st si = s[i];
    bool canOptimize = true;
    int start = si.a;
    if (si.a2 > end) {
      int next = i;
      int max_i = i;
      int max_a2 = 0;
      for (int j = i; j < m; j++) {
        st sj = s[j];
        if (sj.a > end) {
          if (i == j) {
            max_i = j;
            max_a2 = sj.a2;
          }
          break;
        }
        if (max_a2 < sj.a2) {
          max_i = j;
          max_a2 = sj.a2;
        }
        next = j;
      }
      for (int j = i; j <= next; j++) {
        st sj = s[j];
        if (j == max_i) {
          r[sj.i] = 0;
        } else {
          r[sj.i] = 1;
          optimized++;
        }
      }
      i = next;
      end = max_a2;
    } else {
      r[si.i] = 1;
      optimized++;
    }
  }
  cout << optimized << endl;
  if (optimized > 0) {
    for (int i = 0; i < m; i++) {
      if (r[i] > 0) {
        cout << (i + 1) << " ";
      }
    }
    cout << endl;
  }
  delete[] s;
  return 0;
}
