#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int m, n;
  cin >> n >> m;
  vector<int> ans;
  int last_start = 0;
  int last = 0;
  vector<pair<int, pair<int, int> > > arr(m);
  for (int i = 0; i < m; ++i) {
    cin >> arr[i].first >> arr[i].second.first;
    arr[i].second.first *= -1;
    arr[i].second.second = i + 1;
  }
  sort(arr.begin(), arr.end());
  int cur = 0;
  int cur_max = 0;
  int max_num = 0;
  vector<pair<int, pair<int, int> > > tmp;
  for (int i = 0; i < m; ++i) {
    int x = arr[i].first;
    int l = -arr[i].second.first;
    int num = arr[i].second.second;
    if (x > cur) {
      cur = cur_max;
      if (x > cur) ans.push_back(num);
      ans.push_back(max_num);
    }
    if (cur_max < x + l) {
      cur_max = x + l;
      max_num = num;
    }
  }
  ans.push_back(max_num);
  sort(ans.begin(), ans.end());
  ans.resize(unique(ans.begin(), ans.end()) - ans.begin());
  vector<int> ret;
  for (int i = 1; i <= m; ++i)
    if (!binary_search(ans.begin(), ans.end(), i)) ret.push_back(i);
  cout << ret.size() << endl;
  for (int i = 0; i < ret.size(); ++i) cout << ret[i] << " ";
  cout << endl;
  return 0;
}
