#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, k, id[N], px[15], py[15];
int A[N], B[N], C[N];
int rnd() {
  int x = 0;
  for (int i = (int)(1); i <= (int)(9); i++) x = x * 10 + rand() % 10;
  return x;
}
bool check(int a, int b, int c) {
  if (!A[a]) swap(a, b);
  if (!A[a]) swap(a, c);
  long long v1 = 1ll * A[a] * B[b] - 1ll * A[b] * B[a];
  long long v2 = 1ll * A[a] * C[b] - 1ll * A[b] * C[a];
  long long v3 = 1ll * A[a] * B[c] - 1ll * A[c] * B[a];
  long long v4 = 1ll * A[a] * C[c] - 1ll * A[c] * C[a];
  return 1ll * v4 * v1 == 1ll * v2 * v3;
}
void HEIHEIHEI() {
  int top = n;
  for (int i = (int)(1); i <= (int)(top); i++) id[i] = i;
  int rem = k;
  for (int j = 1; j <= 80 && rem && rem < top; ++j) {
    int a = id[rnd() % top + 1];
    int b = id[rnd() % top + 1];
    if (1ll * A[a] * B[b] == 1ll * B[a] * A[b]) continue;
    int tmp = 0, sum = 0;
    for (int j = (int)(1); j <= (int)(top); j++)
      if (check(a, b, id[j])) ++sum;
    if (sum * rem < top) continue;
    px[rem] = a;
    py[rem] = b;
    for (int j = (int)(1); j <= (int)(top); j++)
      if (!check(a, b, id[j])) id[++tmp] = id[j];
    top = tmp;
    --rem;
  }
  if (rem >= top) {
    puts("YES");
    printf("%d\n", top + k - rem);
    for (int j = (int)(1); j <= (int)(top); j++) printf("%d -1\n", id[j]);
    for (int j = (int)(rem + 1); j <= (int)(k); j++)
      printf("%d %d\n", px[j], py[j]);
    exit(0);
  }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = (int)(1); i <= (int)(n); i++)
    scanf("%d%d%d", &A[i], &B[i], &C[i]);
  for (int T = (int)(1); T <= (int)(10); T++) HEIHEIHEI();
  puts("NO");
}
