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 JAVA):

Solution:

import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		InputReader in = new InputReader (System.in);
		PrintWriter out = new PrintWriter (System.out);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
	int[][] ans;
	int tot;
	class Line {
		int a,b,c,id;
	};
	
	public void solve (int TestNumber, InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int k = in.nextInt();
		Line[] road = new Line[n];
		for (int i = 0; i < n; ++i) {
			road[i] = new Line();//initialize is necessary
			road[i].a = in.nextInt();
			road[i].b = in.nextInt();
			road[i].c = in.nextInt();
			road[i].id = i+1;
		}
		ans = new int[k][2];
		tot = -1;
		calc(road, k);
		if (tot == -1) {
			out.println("NO");
			return;
		}
		out.println("YES");
		out.println(k-tot);
		for (int i = tot; i < k; ++i) {
			out.println(ans[i][0] + " " + ans[i][1]);
		}
	}
	//Java 特点，有了.length,就不用记录数组长度了；有了for each: 就不用枚举下标了
	private void calc(Line[] road, int k) {
		if (road.length > k*k) {
			if (k == 0) return;
			double pr = 1.0 - getPr(road.length,k);
			int cnt = 1;
			double s = pr;
			while (s > 1e-10) {
				++cnt;
				s *= pr;
			}
			Random rand = new Random(19950315L + System.currentTimeMillis());
			for ( ;cnt > 0; --cnt) {
				Line p = road[rand.nextInt(road.length)];
				Line q = road[rand.nextInt(road.length)];
				int denom = p.a*q.b-p.b*q.a;
				if (denom == 0) continue;
				int x = -(p.c*q.b-p.b*q.c);
				int y = -(p.a*q.c-p.c*q.a);
				
				int num = 0;
				for (Line r : road) {
					if (r.a*x+r.b*y+r.c*denom == 0) ++num;
				}
				if (num > k) {
					ans[k-1][0] = p.id; 
					ans[k-1][1] = q.id;
					int t_tot = 0;
					Line[] n_road = new Line[road.length - num];
					for (Line r : road) {
						if (r.a*x+r.b*y+r.c*denom != 0) {
							n_road[t_tot++] = r;
						}
					}
					calc(n_road, k-1);
					return;
				}
			}
		}
		else if (road.length == 0) {
			tot = k;
		}
		else {
			Random rand = new Random(19950315L + System.currentTimeMillis());
			Line p = road[rand.nextInt(road.length)];
			boolean[] mark = new boolean[road.length];
			Arrays.fill(mark, false);
			boolean any = false;
			for (int i = 0; i < road.length; ++i) {
				if (mark[i]) continue;
				Line q = road[i];
				int denom = p.a*q.b-p.b*q.a;
				if (denom == 0) continue;
				any = true;
				int x = -(p.c*q.b-p.b*q.c);
				int y = -(p.a*q.c-p.c*q.a);
				
				int num = 0;
				for (int j = 0; j < road.length; ++j) {
					Line r = road[j];
					if (r.a*x+r.b*y+r.c*denom == 0) {
						++num;
						mark[j] = true;
					}
				}
				Line[] n_road = new Line[road.length - num];
				ans[k-1][0] = p.id; 
				ans[k-1][1] = q.id;
				int n_tot = 0;
				for (Line r : road) {
					if (r.a*x+r.b*y+r.c*denom != 0) {
						n_road[n_tot++] = r;
					}
				}
				calc(n_road, k-1);
				if (tot > -1) return;
			}
			if (!any) {
				ans[k-1][0] = p.id; 
				ans[k-1][1] = -1;
				Line[] n_road = new Line[road.length - 1];
				int n_tot = 0;
				for (Line r : road) {
					if (r != p) {
						n_road[n_tot++] = r;
					}
				}
				calc(n_road, k-1);
			}
		}
	}
	
	private double getPr(int n, int k) {
		long ret = Long.MAX_VALUE;
		for (int small = 0; small < k; ++small) {
			int rem = n - small * k;
			int big = k - small; 	
			long pair = 0;
			for (int id = 0; id < big; ++id) {
				long size = rem / big;//size 得 long不能 int
				if (rem % big > id) ++size;
				pair += size*(size-1);
			}
			ret = Math.min(ret, pair);
		}
		return (double)ret/n/n;
	}
}

class InputReader {
	BufferedReader reader;
	StringTokenizer tokenizer;
	
	public InputReader (InputStream stream) {
		reader = new BufferedReader (new InputStreamReader(stream), 32768);
		tokenizer = null;
	}
	
	public String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer (reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException (e);
			}
		}
		return tokenizer.nextToken();
	}
	
	public int nextInt() {
		return Integer.parseInt(next());
	}
}