#include <bits/stdc++.h>
using namespace std;
int const N = 2e5 + 123;
vector<int> ans;
vector<int> p;
int n, m, l[N], r[N], len[N], take[N];
bool cmp(int i, int j) { return l[i] < l[j]; }
void solve() {
  for (int i = 0; i < m; ++i) r[i] = l[i] + len[i] - 1, p.push_back(i);
  sort(p.begin(), p.end(), cmp);
  int cur = -1;
  int pos = 0;
  int id = -1;
  for (int i = 1; i < n + 2; ++i) {
    while (pos < m && l[p[pos]] == i) {
      if (id == -1 || r[p[pos]] > r[id]) {
        id = p[pos];
      }
      ++pos;
    }
    if (i > cur) {
      if (r[id] >= i) {
        cur = r[id];
        take[id] = 1;
      }
    }
  }
  for (int i = 0; i < m; ++i)
    if (!take[i]) ans.push_back(i);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) scanf("%d %d", &l[i], &len[i]);
  solve();
  printf("%d\n", (int)(ans.size()));
  sort(ans.begin(), ans.end());
  for (int i = 0; i < (int)(ans.size()); ++i) printf("%d ", ans[i] + 1);
  return 0;
}
