#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
const int N = 2e5 + 1;
bool used[N];
int n, m;
int cnt;
struct Range {
  int first;
  int second;
  int id;
} p[N];
int getint() {
  char inp;
  int res = 0;
  while ((inp = getchar()) && !(inp >= '0' && inp <= '9'))
    ;
  do {
    res = res * 10 + inp - '0';
  } while ((inp = getchar()) && (inp >= '0' && inp <= '9'));
  return res;
}
void input() {
  m = getint();
  n = getint();
  for (int i = 0; i < n; ++i) {
    p[i].first = getint();
    p[i].second = getint();
    p[i].second += p[i].first;
    p[i].id = i;
  }
  sort(p, p + n, [](Range x, Range y) {
    return pair<int, int>(x.first, -x.second) <
           pair<int, int>(y.first, -y.second);
  });
}
void solve() {
  int lst = 0;
  int mxm = p[0].first;
  int opt = p[0].id;
  for (int i = 0; i < n; ++i) {
    if (p[i].first > lst) {
      used[opt] = 1;
      lst = mxm;
    }
    if (p[i].second > mxm) {
      mxm = p[i].second;
      opt = p[i].id;
    }
  }
  used[opt] = 1;
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    cnt += !used[i];
  }
  cout << cnt << "\n";
  for (int i = 0; i < n; ++i) {
    if (!used[i]) {
      cout << i + 1 << " ";
    }
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  input();
  solve();
}
