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