import std.stdio,std.conv, std.algorithm;
import std.container,std.array,std.range;
import std.string,std.typecons,std.numeric;
import std.math,std.random,std.functional,std.regex;


double getExpected(int[] vs,double[] rs,int n,int m){
	double res = 0;	
	double sum = rs.sum;
	foreach(i;0..m){
		res += vs[i] * rs[i] / sum; 
	}
	return res; 
}


void main(){	
	int t = read(); // ?????????????????°
	t ++; 
	double max_p = 0;
	double last_p = 0;
    foreach(i;0..t){
		int n,m;   // m (??°?????????)< n
		read(n,m);
		auto vs = new int [m];
		auto rs = new double [m];
		foreach(j;0..m) read(vs[j],rs[j]);
	    auto p = getExpected(vs,rs,n, m);
		if (i == t-1)last_p = p; 
		else max_p = max_p.max(p);
		//p.writeln;
	}
	//max_p.writeln;
	//last_p.writeln;
	if(last_p < max_p) "YES".writeln;
	else "NO".writeln;
}














int   read(){int n;read(n);return n;}
void  read(T...)  (auto ref T args){mixin(readMixin);}
void  readArray(T)(auto ref T args){mixin(readMixin);}
const readMixin = q{
	auto line = readln().split();
	foreach(i,ref arg; args){
		if (i >= line.length) return;
		arg = line[i].to!(typeof(arg));
	}
};
void times(int n,void delegate() stmt){ foreach(i;0..n)stmt();}
void Swap(T)(ref T a,ref T b){T t = a;a = b;b = t;}