#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
pair<int, int> ans[6];
struct Line {
  double a, b, c;
  int id;
};
struct point {
  double x, y;
};
inline int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return x > 0 ? 1 : -1;
}
inline int inter(Line L1, Line L2, point &p) {
  double a1 = L1.a, b1 = L1.b, c1 = L1.c, a2 = L2.a, b2 = L2.b, c2 = L2.c;
  if (dcmp(a1 * b2 - a2 * b1) == 0) return false;
  p = (point){(b1 * c2 - c1 * b2) / (a1 * b2 - b1 * a2),
              (a1 * c2 - c1 * a2) / (b1 * a2 - a1 * b2)};
  return true;
}
vector<Line> L;
int main() {
  int i, j, k, m, n, ret;
  double a, b, c;
  L.clear();
  scanf("%d %d", &n, &k);
  for (i = 1; i <= n; i++)
    scanf("%lf %lf %lf", &a, &b, &c), L.push_back((Line){a, b, c, i});
  int p = 0;
  while (!L.empty()) {
    if (k >= L.size()) {
      ans[++p] = make_pair(L[L.size() - 1].id, -1);
      L.pop_back();
      continue;
    }
    point tp;
    for (i = 1; i <= 100; i++) {
      int a = rand() % L.size(), b = rand() % L.size();
      if (!inter(L[a], L[b], tp)) continue;
      ret = 0;
      for (j = 0; j < L.size(); j++) {
        Line &u = L[j];
        if (dcmp(tp.x * u.a + tp.y * u.b + u.c) == 0) ret++;
      }
      if (ret * k >= L.size()) {
        ans[++p] = make_pair(L[a].id, L[b].id);
        break;
      }
    }
    if (i > 100) goto End;
    for (j = L.size() - 1; j >= 0; j--) {
      Line u = L[j];
      if (dcmp(tp.x * u.a + tp.y * u.b + u.c) == 0)
        swap(L[j], L[L.size() - 1]), L.pop_back();
    }
    k--;
  }
  puts("YES");
  printf("%d\n", p);
  for (i = 1; i <= p; i++) printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
End:
  puts("NO");
}
