The teacher gave Anton a large geometry homework, but he didn't do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = k_{i}·x + b_{i}. It was necessary to determine whether there is at least one point of intersection of two of these lines, that lays strictly inside the strip between x_1 < x_2. In other words, is it true that there are 1 ≤ i < j ≤ n and x', y', such that:   y' = k_{i} * x' + b_{i}, that is, point (x', y') belongs to the line number i;  y' = k_{j} * x' + b_{j}, that is, point (x', y') belongs to the line number j;  x_1 < x' < x_2, that is, point (x', y') lies inside the strip bounded by x_1 < x_2. 

You can't leave Anton in trouble, can you? Write a program that solves the given task.


-----Input-----

The first line of the input contains an integer n (2 ≤ n ≤ 100 000) — the number of lines in the task given to Anton. The second line contains integers x_1 and x_2 ( - 1 000 000 ≤ x_1 < x_2 ≤ 1 000 000) defining the strip inside which you need to find a point of intersection of at least two lines.

The following n lines contain integers k_{i}, b_{i} ( - 1 000 000 ≤ k_{i}, b_{i} ≤ 1 000 000) — the descriptions of the lines. It is guaranteed that all lines are pairwise distinct, that is, for any two i ≠ j it is true that either k_{i} ≠ k_{j}, or b_{i} ≠ b_{j}.


-----Output-----

Print "Yes" (without quotes), if there is at least one intersection of two distinct lines, located strictly inside the strip. Otherwise print "No" (without quotes).


-----Examples-----
Input
4
1 2
1 2
1 0
0 1
0 2

Output
NO
Input
2
1 3
1 0
-1 3

Output
YES
Input
2
1 3
1 0
0 2

Output
YES
Input
2
1 3
1 0
0 3

Output
NO


-----Note-----

In the first sample there are intersections located on the border of the strip, but there are no intersections located strictly inside it. [Image]

Difficulty: MEDIUM_HARD

Solutions:
n = int(input())
(x1, x2) = map(int, input().split())
y_range = []
for _ in range(n):
	(k, b) = map(int, input().split())
	y_range.append((x1 * k + b, x2 * k + b))
y_range.sort(key=lambda x: (x[0], x[1]))
no = True
for i in range(n - 1):
	if y_range[i][1] > y_range[i + 1][1]:
		no = False
		break
if no:
	print('NO')
else:
	print('YES')


import itertools as it
import functools
import operator
import collections
import math
import sys
EPSILON = 1e-09

def solve(x1, x2, kbs):
	at_x1 = [k * (x1 + EPSILON) + b for (k, b) in kbs]
	at_x2 = [k * (x2 - EPSILON) + b for (k, b) in kbs]
	order1 = [i for (i, _) in sorted(enumerate(at_x1), key=operator.itemgetter(1))]
	return any((at_x2[i] > at_x2[j] for (i, j) in zip(order1, order1[1:])))

def print_stderr(*args, **kwargs):
	print(*args, file=sys.stderr, **kwargs)

def tf_to_yn(tf):
	return 'YES' if tf else 'NO'

def main():
	n = int(input())
	[x1, x2] = [int(i) for i in input().strip().split()]
	kbs = [tuple((int(i) for i in input().strip().split())) for _ in range(n)]
	result = solve(x1, x2, kbs)
	print(tf_to_yn(result))

def __starting_point():
	main()
__starting_point()


import sys
import collections
import math
points = []
n = int(sys.stdin.readline())
[x1, x2] = [int(i) for i in sys.stdin.readline().split()]
for x in range(n):
	[k, b] = [int(i) for i in sys.stdin.readline().split()]
	points.append((k * x1 + b, k * x2 + b))
points.sort(key=lambda x: (x[0], x[1]))
flag = False
for i in range(1, n):
	if points[i - 1][1] > points[i][1]:
		flag = True
		break
if flag:
	print('YES')
else:
	print('NO')


import os
import sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	(x, y) = map(int, input().split())
	arr = []
	for _ in range(n):
		(k, b) = map(int, input().split())
		arr.append([k * x + b, k * y + b])
	arr.sort()
	ans = 'NO'
	for i in range(n - 1):
		(a, b) = (arr[i], arr[i + 1])
		if a[0] < b[0] and a[1] > b[1]:
			ans = 'YES'
			break
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
from sys import stdin, stdout
n = int(input())
(x1, x2) = [int(x) for x in input().split()]
cuts = []
for i in range(n):
	(k, b) = [int(x) for x in input().split()]
	cuts.append([k * x1 + b, k * x2 + b])
res = sorted(cuts, key=lambda x: (x[0], x[1]))
max1_e = res[0][0]
max2_e = res[0][1]
ok = True
for i in range(1, len(res)):
	prev = res[i - 1]
	cur = res[i]
	if cur[1] < max2_e:
		stdout.write('YES\n')
		ok = False
		break
	max2_e = max(max2_e, cur[1])
if ok:
	stdout.write('NO\n')


def byfirst(a):
	return a[0]
n = int(input())
(x1, x2) = [int(i) for i in input().split()]
a = {}
for i in range(n):
	(k, b) = [int(i) for i in input().split()]
	(x, y) = (k * x1 + b, k * x2 + b)
	if x in a:
		a[x] += [y]
	else:
		a[x] = [y]
b = list(a.keys())
b.sort()
m = max(a[b[0]])
flag = 0
for i in b[1:]:
	if m > min(a[i]):
		flag = 1
		break
	else:
		m = max(a[i])
if flag:
	print('YES')
else:
	print('NO')


from operator import itemgetter
n = int(input())
(x1, x2) = map(int, input().split())
ls = []
for x in range(n):
	(k, b) = map(int, input().split())
	y1 = k * x1 + b
	y2 = k * x2 + b
	if y1 > y2:
		(y1, y2) = (y2, y1)
	tup = (y1, y2, k, b)
	ls.append(tup)
ls.sort(key=itemgetter(1))
ls.sort(key=itemgetter(0))
f = 0
for x in range(1, len(ls)):
	if ls[x][0] < ls[x - 1][1] and ls[x][2] != ls[x - 1][2]:
		xc = (ls[x][3] - ls[x - 1][3]) / (ls[x - 1][2] - ls[x][2])
		if x1 < xc and xc < x2:
			f = 1
			break
if f == 1:
	print('YES')
else:
	print('NO')


N = int(input())
(x1, x2) = list(map(int, input().split()))
x = []
y = []
for i in range(0, N):
	(m, c) = list(map(int, input().split()))
	x.append((m * (x1 + 1e-10) + c, i))
	y.append((m * (x2 - 1e-10) + c, i))
x.sort()
y.sort()
a = []
b = []
for i in range(N):
	a.append(x[i][1])
	b.append(y[i][1])
if a == b:
	print('NO')
else:
	print('YES')


n = int(input())
(x1, x2) = map(int, input().split())
arr = []
for i in range(n):
	(a, b) = map(int, input().split())
	arr.append([a * x1 + b, a * x2 + b])
arr.sort()
x = [i[1] for i in arr]
if sorted(x) == x:
	print('NO')
else:
	print('YES')


n = int(input())
(x1, x2) = map(int, input().split())
ps = [map(int, input().split()) for _ in range(n)]
ys = [0] * n
for (i, (k, b)) in enumerate(ps):
	ys[i] = (k * x1 + b, k * x2 + b)
ys.sort()
max_y = -float('inf')
ok = False
for (y1, y2) in ys:
	if y2 < max_y:
		ok = True
		break
	max_y = max(max_y, y2)
print('YES' if ok else 'NO')


def main():
	n = int(input())
	(x1, x2) = map(int, input().split())
	res = []
	for _ in range(n):
		(k, b) = map(int, input().split())
		res.append((k * x1 + b, k * x2 + b))
	res.sort()
	print(('NO', 'YES')[any((y1[1] > y2[1] for (y1, y2) in zip(res, res[1:])))])
main()


n = int(input().strip())
(x1, x2) = [int(a) for a in input().strip().split()]
intersect1 = []
for i in range(n):
	(a, c) = [int(a) for a in input().strip().split()]
	intersect1.append([a * x1 + c, a * x2 + c])
intersect1.sort(key=lambda element: (element[0], element[1]))
for i in range(n - 1):
	if intersect1[i][0] < intersect1[i + 1][0] and intersect1[i][1] > intersect1[i + 1][1]:
		print('YES')
		exit()
print('NO')


def equation(k, x, b):
	return k * x + b
num = int(input())
ans = []
(x1, x2) = map(int, input().split())
for i in range(0, num):
	(k, b) = map(int, input().split())
	ans.append((equation(k, x1, b), equation(k, x2, b)))
ans.sort()
for i in range(1, num):
	if ans[i][0] > ans[i - 1][0] and ans[i][1] < ans[i - 1][1] or (ans[i - 1][0] < ans[i][0] and ans[i - 1][1] > ans[i][1]):
		print('YES')
		exit()
print('NO')


def ur(k, x, b):
	return k * x + b
n = int(input())
lst = []
(x1, x2) = map(int, input().split())
for i in range(n):
	(k, b) = map(int, input().split())
	lst.append((ur(k, x1, b), ur(k, x2, b)))
lst.sort()
for i in range(1, n):
	if lst[i][0] > lst[i - 1][0] and lst[i][1] < lst[i - 1][1] or (lst[i - 1][0] < lst[i][0] and lst[i - 1][1] > lst[i][1]):
		print('YES')
		break
else:
	print('NO')


n = int(input())
(x1, x2) = map(int, input().split(' '))
liste = []
for test in range(n):
	(k, b) = map(int, input().split(' '))
	liste.append((k * x1 + b, k * x2 + b))
liste.sort()
flag = 0
i = 1
while i < n:
	if liste[i][1] < liste[i - 1][1]:
		flag = 1
		break
	i += 1
print(['NO', 'YES'][flag])


n = int(input())
points = []
flag = False
(x1, x2) = map(int, input().split())
for i in range(n):
	(a, b) = map(int, input().split())
	points.append((a, b))
p = []
for i in range(n):
	p.append((points[i][0] * x1 + points[i][1], points[i][0] * x2 + points[i][1]))
p.sort()
for i in range(n - 1):
	if p[i][0] != p[i + 1][0]:
		if p[i][1] > p[i + 1][1]:
			flag = True
if flag:
	print('YES')
else:
	print('NO')


n = int(input())
(x1, x2) = map(int, input().split())
x1 += 10 ** (-8)
x2 -= 10 ** (-8)
lines = []
for i in range(n):
	lines.append(list(map(int, input().split())))
ord_left = []
ord_right = []
for i in range(n):
	ord_left.append(lines[i][0] * x1 + lines[i][1])
	ord_right.append(lines[i][0] * x2 + lines[i][1])
enum_l = list(range(n))
enum_r = list(range(n))
enum_l.sort(key=lambda ord: ord_left[ord])
enum_r.sort(key=lambda ord: ord_right[ord])
if enum_l == enum_r:
	print('NO')
else:
	print('YES')


n = int(input())
(x1, x2) = map(float, input().split())
arr = []
for i in range(n):
	(p, q) = map(float, input().split())
	r1 = p * x1 + q
	r2 = p * x2 + q
	arr.append((r1, r2))
arr = sorted(arr)
flag = False
for i in range(n - 1):
	if arr[i][0] < arr[i + 1][0] and arr[i][1] > arr[i + 1][1]:
		flag = True
		break
if flag:
	print('YES')
else:
	print('NO')


k = []
x = int(input())
(c, d) = list(map(int, input().split(' ')))
for i in range(x):
	(a, b) = list(map(int, input().split(' ')))
	k.append([c * a + b, d * a + b])
k.sort()
for i in range(len(k) - 1):
	if k[i + 1][1] < k[i][1]:
		print('YES')
		quit()
print('NO')


n = int(input())
(x1, x2) = map(int, input().split())
points = [list(map(int, input().split())) for _ in range(n)]
one = list()
two = list()
for i in range(n):
	(k, b) = points[i]
	one.append((k * (x1 + 1e-10) + b, i))
	two.append((k * (x2 - 1e-10) + b, i))
one.sort()
two.sort()
overlap = False
for i in range(n):
	if one[i][1] != two[i][1]:
		overlap = True
		break
if overlap:
	print('YES')
else:
	print('NO')


n = int(input())
(x1, x2) = map(int, input().split())
(k, b) = ([], [])
for _ in range(n):
	(kk, bb) = map(int, input().split())
	k.append(kk)
	b.append(bb)
at1 = sorted(range(n), key=lambda i: k[i] * (x1 + 1e-08) + b[i])
at2 = sorted(range(n), key=lambda i: k[i] * (x2 - 1e-08) + b[i])
print(['YES', 'NO'][at1 == at2])


n = int(input())
done = False
(a, b) = map(int, input().split())
a += 1 / 4000000
b -= 1 / 4000000
lol = []
wow = []
for i in range(n):
	(k, c) = map(int, input().split())
	lol.append([k * a + c, i])
	wow.append([k * b + c, i])
wow.sort()
lol.sort()
for i in range(n):
	if lol[i][1] != wow[i][1]:
		print('YES')
		done = True
		break
if not done:
	print('NO')


ada = False
n = input()
apapun = input().split()
x1 = int(apapun[0])
x2 = int(apapun[1])
y = []
for i in range(int(n)):
	whatevs = ''
	whatevs = input().split()
	y.append([int(whatevs[0]) * x1 + int(whatevs[1]), int(whatevs[0]) * x2 + int(whatevs[1])])
y = sorted(y, key=lambda x: (x[0], x[1]))
for i in range(1, len(y)):
	if y[i][1] < y[i - 1][1]:
		ada = True
		break
if ada:
	print('YES')
else:
	print('NO')


n = int(input())
a = list()
(x1, x2) = map(int, input().split())
for i in range(n):
	(k, b) = map(int, input().split())
	y1 = k * x1 + b
	y2 = k * x2 + b
	a.append((y1, y2))
a.sort()
fl = 'NO'
y1m = a[0][0]
y2m = a[0][1]
for (y1, y2) in a:
	if y2 < y2m:
		fl = 'YES'
	else:
		y2m = max(y2m, y2)
print(fl)


n = int(input())
(x1, x2) = map(int, input().split())
l = []
for i in range(n):
	(ki, bi) = map(int, input().split())
	l.append([x1 * ki + bi, x2 * ki + bi])
l.sort(key=lambda x: (x[0], x[1]))
for i in range(len(l) - 1):
	if l[i][1] > l[i + 1][1]:
		print('YES')
		exit()
print('NO')


n = int(input())
a = input().split(' ')
x1 = int(a[0])
x2 = int(a[1])
coor1 = []
coor2 = []
eps = 1e-09
for i in range(n):
	a = input().split(' ')
	k = int(a[0])
	b = int(a[1])
	coor1.append((k * (x1 + eps) + b, i))
	coor2.append((k * (x2 - eps) + b, i))
coor1.sort()
coor2.sort()
s = 'NO'
for i in range(len(coor1)):
	if coor1[i][1] != coor2[i][1]:
		s = 'YES'
print(s)


import sys
input = sys.stdin.readline
n = int(input())
(x1, x2) = map(int, input().split())
s = []
for _ in range(n):
	(k, b) = map(int, input().split())
	s.append([x1 * k + b, x2 * k + b])
s.sort()
ans = 'NO'
for i in range(1, n):
	(x1, x2) = s[i - 1]
	(x3, x4) = s[i]
	if x1 < x3 and x2 > x4 or (x1 > x3 and x2 < x4):
		ans = 'YES'
		break
print(ans)


from sys import stdin

def entryPoint(m, c):
	global x1
	return m * x1 + c
(size, lines) = (int(input()), [])
(x1, x2) = map(int, input().split())
for l in stdin.readlines():
	(m, c) = map(int, l.split())
	lines.append((entryPoint(m, c), m, c))
lines.sort()
for x in range(size - 1):
	if lines[x][1] != lines[x + 1][1]:
		intersection = (lines[x + 1][2] - lines[x][2]) / (lines[x][1] - lines[x + 1][1])
		if intersection > x1 and intersection < x2:
			print('YES')
			exit()
print('NO')


n = int(input())
(x1, x2) = list(map(float, input().split()))
x1 += 1e-10
x2 -= 1e-10
lines = [tuple(map(float, input().split())) for _ in range(n)]
l1 = sorted(((k * x1 + b, i) for (i, (k, b)) in enumerate(lines)))
l2 = sorted(((k * x2 + b, i) for (i, (k, b)) in enumerate(lines)))
if [i for (x, i) in l1] == [i for (x, i) in l2]:
	print('NO')
else:
	print('YES')


def cross(l1, l2, x2):
	return l2[0] * x2 + l2[1] < l1[0] * x2 + l1[1]

def __starting_point():
	n = int(input())
	(x1, x2) = list(map(int, input().split()))
	data = [tuple(map(int, input().split())) for i in range(n)]
	data = list(sorted(data, key=lambda x: (x[0] * x1 + x[1], x[0] * x2 + x[1])))
	for i in range(len(data) - 1):
		if cross(data[i], data[i + 1], x2):
			print('YES')
			return
	print('NO')
__starting_point()


import sys
input = sys.stdin.buffer.readline
n = int(input())
(l, r) = map(int, input().split())
ly = []
ry = []
for i in range(n):
	(k, m) = map(int, input().split())
	ly.append([k * (l + 10 ** (-8)) + m, i])
	ry.append([k * (r - 10 ** (-8)) + m, i])
ly.sort(key=lambda x: (x[0], x[1]))
ry.sort(key=lambda x: (x[0], x[1]))
for i in range(n):
	if ly[i][1] != ry[i][1]:
		print('YES')
		break
else:
	print('NO')


import sys
n = int(input())
k = []
b = []
(x1, x2) = (int(i) for i in input().split())
for i in range(n):
	(k1, b1) = (int(j) for j in input().split())
	k.append(k1)
	b.append(b1)
zn = [(k[i] * x1 + b[i], k[i] * x2 + b[i]) for i in range(n)]
zn.sort()
found = False
for i in range(n - 1):
	if zn[i][1] > zn[i + 1][1]:
		found = True
		break
if found:
	print('YES')
else:
	print('NO')


def main():
	n = int(input())
	(x1, x2) = map(int, input().split())
	res = []
	for _ in range(n):
		(k, b) = map(int, input().split())
		res.append((k * x1 + b, k * x2 + b))
	res.sort()
	(_, a) = res[0]
	for (_, b) in res:
		if a > b:
			print('YES')
			return
		a = b
	print('NO')
main()


n = int(input())
(X, Y) = input().split()
(X, Y) = (float(X) + 1e-10, float(Y) - 1e-10)
L = [list(map(float, input().split())) for _ in range(n)]
print('NO' if [i for (x, i) in sorted(((k * X + b, i) for (i, (k, b)) in enumerate(L)))] == [i for (x, i) in sorted(((k * Y + b, i) for (i, (k, b)) in enumerate(L)))] else 'YES')


def main():
	N = int(input())
	(X1, X2) = [int(i) for i in input().split()]
	X1 += 1e-08
	X2 -= 1e-08
	retas = []
	for n in range(N):
		retas.append([int(i) for i in input().split()])
	B1 = {}
	B2 = {}
	for n in range(N):
		k = retas[n][0]
		b = retas[n][1]
		B1[k * X1 + b] = n
		B2[k * X2 + b] = n
	L1 = list(B1.keys())
	L2 = list(B2.keys())
	L1.sort()
	L2.sort()
	flag = True
	for n in range(N):
		if B1[L1[n]] != B2[L2[n]]:
			flag = False
			break
	if not flag:
		print('YES')
	else:
		print('NO')
main()


n = int(input())
(x1, x2) = [int(i) for i in input().split()]
funcs = []
m = 0
L = []
R = []
for i in range(n):
	k = input()
	b = int(k.split()[1])
	k = int(k.split()[0])
	L.append((k * x1 + b, k, i))
	R.append((k * x2 + b, -k, i))
L.sort()
R.sort()
L = [i[2] for i in L]
R = [i[2] for i in R]
print(['YES', 'NO'][L == R])


n = int(input())
(x, y) = map(int, input().split())
(u, v) = ([], [])
x += 1e-07
y -= 1e-07
for i in range(n):
	(k, m) = map(int, input().split())
	u += [(k * x + m, i)]
	v += [(k * y + m, i)]
(u, v) = (sorted(u), sorted(v))
for i in range(n):
	if u[i][1] != v[i][1]:
		print('YES')
		break
else:
	print('NO')


ertekek = []
n = int(input())
(x1, x2) = [int(i) for i in input().split()]
for i in range(n):
	(k, b) = [int(i) for i in input().split()]
	bal = k * x1 + b
	jobb = k * x2 + b
	ertekek.append([bal, jobb])
ertekek.sort()
szamlalo = 0
for i in range(len(ertekek) - 1):
	if ertekek[i][0] < ertekek[i + 1][0] and ertekek[i][1] > ertekek[i + 1][1]:
		szamlalo += 1
if szamlalo > 0:
	print('YES')
else:
	print('NO')


def check(y1, y2, n):
	for i in range(n):
		if y1[i][1] != y2[i][1]:
			return 'YES'
	return 'NO'
n = int(input())
eps = 10 ** (-7)
(x1, x2) = map(int, input().split())
y1 = list()
y2 = list()
for i in range(n):
	(k, b) = map(int, input().split())
	f = lambda x: k * x + b
	y1.append((f(x1 + eps), i))
	y2.append((f(x2 - eps), i))
y1.sort()
y2.sort()
print(check(y1, y2, n))


n = int(input())
(x1, x2) = [float(x) for x in input().split()]
delta = 1e-07
y1 = list()
y2 = list()
new_x1 = x1 + delta
new_x2 = x2 - delta
for i in range(n):
	(k, b) = [int(x) for x in input().split()]
	y1.append((i, k * new_x1 + b))
	y2.append((i, k * new_x2 + b))
y1.sort(key=lambda x: x[1])
y2.sort(key=lambda x: x[1])
has_intersection = False
for i in range(n):
	if y1[i][0] is not y2[i][0]:
		has_intersection = True
if has_intersection:
	print('YES')
else:
	print('NO')


n = int(input())
R = lambda : map(int, input().split())
(x1, x2) = R()
b = []
V = lambda k, x, b: k * x + b
for _ in range(n):
	(ki, bi) = R()
	v1 = V(ki, x1, bi)
	v2 = V(ki, x2, bi)
	b.append((v1, v2))
b = sorted(b)
for i in range(n - 1):
	if b[i + 1][1] < b[i][1]:
		print('YES')
		exit()
print('NO')


n = int(input())
(x1, x2) = map(int, input().split())
s = []
for i in range(n):
	(m, b) = map(int, input().split())
	s.append([x1 * m + b, x2 * m + b])
s.sort()
j = 0
for i in range(1, n):
	if s[i - 1][1] > s[i][1]:
		j = 1
print(['NO', 'YES'][j])


import sys

def main():
	n = int(input())
	(x1, x2) = map(int, input().split())
	s = []
	for _ in range(n):
		(k, b) = map(int, sys.stdin.readline().split())
		s += [[k * x1 + b, k * x2 + b]]
	s.sort()
	for i in range(1, n):
		if s[i][1] < s[i - 1][1]:
			print('YES')
			return
	print('NO')
main()


n = int(input())
(x1, x2) = map(int, input().split())
mass = []
for i in range(n):
	(k, b) = map(int, input().split())
	mass.append((k, b))
tmp_mass = [0] * len(mass)
for i in range(len(mass)):
	tmp_mass[i] = (mass[i][1] + mass[i][0] * x1, mass[i][1] + mass[i][0] * x2)
tmp_mass.sort(key=lambda x: (x[0], x[1]))
flag = False
for i in range(n - 1):
	if tmp_mass[i][1] > tmp_mass[i + 1][1] and tmp_mass[i + 1][0] != tmp_mass[i][0]:
		flag = True
		break
if flag:
	print('YES')
else:
	print('NO')


def rline():
	return [int(i) for i in input().split()]
N = int(input())
(L, R) = rline()
l = [rline() for i in range(N)]
atL = []
atR = []
for i in range(N):
	(k, b) = l[i]
	atL.append((k * L + b, k, i))
	atR.append((k * R + b, -k, i))
atL.sort()
atR.sort()
atL = [i[2] for i in atL]
atR = [i[2] for i in atR]
print(['YES', 'NO'][atL == atR])


import sys
n = int(sys.stdin.readline())
(x1, x2) = map(int, sys.stdin.readline().split())
a = []
k = [0] * n
for i in range(n):
	k[i] = list(map(int, sys.stdin.readline().split()))
	y1 = k[i][0] * x1 + k[i][1]
	y2 = k[i][0] * x2 + k[i][1]
	a.append((y1, y2))
a.sort()
f = False
x = a[0][1]
for (y1, y2) in a:
	if y2 < x:
		f = True
	else:
		x = max(x, y2)
if f:
	print('YES')
else:
	print('NO')