Problem: One Khanate had a lot of roads and very little wood. Riding along the roads was inconvenient, because the roads did not have road signs indicating the direction to important cities.

The Han decided that it's time to fix the issue, and ordered to put signs on every road. The Minister of Transport has to do that, but he has only k signs. Help the minister to solve his problem, otherwise the poor guy can lose not only his position, but also his head.

More formally, every road in the Khanate is a line on the Oxy plane, given by an equation of the form Ax + By + C = 0 (A and B are not equal to 0 at the same time). You are required to determine whether you can put signs in at most k points so that each road had at least one sign installed.

Input

The input starts with two positive integers n, k (1 ≤ n ≤ 105, 1 ≤ k ≤ 5)

Next n lines contain three integers each, Ai, Bi, Ci, the coefficients of the equation that determines the road (|Ai|, |Bi|, |Ci| ≤ 105, Ai2 + Bi2 ≠ 0).

It is guaranteed that no two roads coincide.

Output

If there is no solution, print "NO" in the single line (without the quotes).

Otherwise, print in the first line "YES" (without the quotes).

In the second line print a single number m (m ≤ k) — the number of used signs. In the next m lines print the descriptions of their locations.

Description of a location of one sign is two integers v, u. If u and v are two distinct integers between 1 and n, we assume that sign is at the point of intersection of roads number v and u. If u = - 1, and v is an integer between 1 and n, then the sign is on the road number v in the point not lying on any other road. In any other case the description of a sign will be assumed invalid and your answer will be considered incorrect. In case if v = u, or if v and u are the numbers of two non-intersecting roads, your answer will also be considered incorrect.

The roads are numbered starting from 1 in the order in which they follow in the input.

Examples

Input

3 1
1 0 0
0 -1 0
7 -93 0


Output

YES
1
1 2


Input

3 1
1 0 0
0 1 0
1 1 3


Output

NO


Input

2 3
3 4 5
5 6 7


Output

YES
2
1 -1
2 -1

Note

Note that you do not have to minimize m, but it shouldn't be more than k.

In the first test all three roads intersect at point (0,0).

In the second test all three roads form a triangle and there is no way to place one sign so that it would stand on all three roads at once.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int nr, N, K, ap[100009], last_N;
pair<int, int> ans[10];
struct line {
  int a, b, c, init;
};
vector<line> v;
struct point {
  long long a, b, c, d;
  bool operator==(const point &other) const {
    return (1LL * a * other.b == 1LL * b * other.a &&
            1LL * c * other.d == 1LL * d * other.c);
  }
  bool operator<(const point &other) const {
    if (1LL * a * other.b == 1LL * b * other.a)
      return (1LL * c * other.d < 1LL * d * other.c);
    return (1LL * a * other.b < 1LL * b * other.a);
  }
};
bool OnLine(point p, line l) {
  return ((long long)1LL * l.a * p.a * p.d + 1LL * l.b * p.b * p.c +
              1LL * l.c * p.b * p.d ==
          0LL);
}
bool Exist_Intersection(line p, line q) {
  return (1LL * p.a * q.b != 1LL * p.b * q.a);
}
point Intersect(line p, line q) {
  point ans;
  ans.c = (long long)1LL * q.c * p.a - 1LL * q.a * p.c;
  ans.d = (long long)1LL * p.b * q.a - 1LL * q.b * p.a;
  ans.a = (long long)1LL * q.c * p.b - 1LL * q.b * p.c;
  ans.b = (long long)1LL * p.a * q.b - 1LL * q.a * p.b;
  return ans;
}
void Push(int i, int j) { ans[++nr] = make_pair(i, j); }
void Pop() { nr--; }
bool back(int pos, int K, vector<line> v) {
  if (pos == v.size()) return 1;
  if (K < 0) return 0;
  if (ap[pos]) return back(pos + 1, K, v);
  point I;
  for (int i = pos + 1; i < N; i++) {
    if (ap[i]) continue;
    if (Exist_Intersection(v[i], v[pos]) == 0) continue;
    I = Intersect(v[i], v[pos]);
    for (int j = pos; j < N; j++)
      if (OnLine(I, v[j])) ap[j]++;
    Push(v[pos].init, v[i].init);
    if (back(pos + 1, K - 1, v) == 1) return 1;
    Pop();
    for (int j = pos; j < N; j++)
      if (OnLine(I, v[j])) ap[j]--;
  }
  Push(v[pos].init, -1), ap[pos]++;
  if (back(pos + 1, K - 1, v) == 1) return 1;
  Pop(), ap[pos]--;
  return 0;
}
bool solve(int K, vector<line> v) {
  int N = v.size();
  last_N = N;
  if (K >= N) {
    for (int i = 0; i < N; i++) Push(v[i].init, -1);
    return 1;
  }
  if (K < 0) return 0;
  if (N <= K * K) {
    if (back(0, K, v)) return 1;
    return 0;
  }
  int M = K * K + 1, needed = K + 1;
  set<point> inters;
  for (int i = 0; i < N; i++)
    for (int j = i + 1; j < N && j < M; j++) {
      if (Exist_Intersection(v[i], v[j]) == 0) continue;
      point curr = Intersect(v[i], v[j]);
      if (inters.count(curr)) continue;
      inters.insert(curr);
      int nr = 0;
      for (int p = i; p < N && p < M; p++)
        if (OnLine(curr, v[p])) nr++;
      if (nr >= needed) {
        vector<line> apel;
        for (int p = 0; p < N; p++)
          if (!OnLine(curr, v[p])) apel.push_back(v[p]);
        Push(v[i].init, v[j].init);
        if (solve(K - 1, apel)) return 1;
        Pop();
        if (last_N > K * K) return 0;
      }
    }
  return 0;
}
int main() {
  scanf("%d %d", &N, &K);
  for (int i = 1; i <= N; i++) {
    line curr;
    scanf("%d %d %d", &curr.a, &curr.b, &curr.c), curr.init = i;
    v.push_back(curr);
  }
  if (solve(K, v)) {
    printf("YES\n");
    printf("%d\n", nr);
    for (int i = 1; i <= nr; i++)
      printf("%d %d\n", ans[i].first, ans[i].second);
    return 0;
  }
  printf("NO\n");
  return 0;
}