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
Tags: Geometry

Sorting
Skill types: Sorting

Starter code:

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()


n = int(input())
(x1, x2) = map(int, input().split())
seg = []
for _ in range(0, n):
	(k, b) = map(int, input().split())
	y1 = k * x1 + b
	y2 = k * x2 + b
	seg.append((y1, y2))
seg.sort()
for i in range(1, n):
	if seg[i][1] < seg[i - 1][1]:
		print('Yes')
		exit(0)
print('No')


l = []
n = int(input())
(x1, x2) = list(map(int, input().split()))
for _ in range(n):
	(m, c) = list(map(int, input().split()))
	l.append([m * x1 + c, m * x2 + c])
l = sorted(l)
for i in range(1, len(l)):
	if l[i][1] < l[i - 1][1]:
		print('yes')
		exit(0)
print('No')


n = int(input())
eps = 1e-09
(x1, x2) = [int(i) for i in input().split()]
x1 += eps
x2 -= eps
area1 = []
area2 = []
for i in range(n):
	(k, b) = [int(i) for i in input().split()]
	y1 = x1 * k + b
	y2 = x2 * k + b
	area1.append([y1, i])
	area2.append([y2, i])
area1.sort(key=lambda a: a[0])
area2.sort(key=lambda a: a[0])
yep = False
l = len(area1)
for i in range(l):
	if area1[i][1] != area2[i][1]:
		yep = True
		break
if yep:
	print('YES')
else:
	print('NO')


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) = [int(x) for x in input().split(' ')]
YSSorted = []
for i in range(n):
	(k, b) = [int(x) for x in input().split(' ')]
	y1 = k * x1 + b
	y2 = k * x2 + b
	YSSorted.append((y1, y2))
YSSorted.sort(reverse=True)

def solve(YSSorted):
	minY2 = YSSorted[0][1]
	for (y1, y2) in YSSorted:
		if y2 > minY2:
			return 'Yes'
		minY2 = min(minY2, y2)
	return 'No'
print(solve(YSSorted))


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')


from sys import stdin
n = int(stdin.readline())
(x1, x2) = map(int, stdin.readline().split())
ys = []
for i in range(n):
	(m, b) = map(int, stdin.readline().split())
	ys.append([x1 * m + b, x2 * m + b])
ys.sort()
intersect = False
for i in range(1, n):
	if ys[i - 1][1] > ys[i][1]:
		intersect = True
if intersect:
	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())
(l, r) = map(int, input().split())
i = 0
s = []
while i < n:
	(k, b) = map(int, input().split())
	s.append([l * k + b, r * k + b])
	i += 1
s.sort()
y = 0
i = 1
while i < n:
	if s[i - 1][1] > s[i][1]:
		y = 1
	i += 1
print(['NO', 'YES'][y])


n = int(input())
(x1, x2) = map(int, input().split(' '))

def intercepts(k, b):
	y1 = k * x1 + b
	y2 = k * x2 + b
	return [y1, y2]
inter = []
for i in range(n):
	(k, b) = map(int, input().split(' '))
	inter += [intercepts(k, b)]
inter.sort()
right = []
for i in range(n):
	intercept = inter[i]
	right += [intercept[1]]
right2 = []
for thing in right:
	right2 += [thing]
right.sort()
if right == right2:
	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')


import sys
n = int(input())
(x1, x2) = [int(tmp) for tmp in input().split()]
k = []
b = []
kek = 0
lel = 0
for i in range(n):
	(tmpk, tmpb) = [int(tmp) for tmp in input().split()]
	k.append(tmpk)
	b.append(tmpb)
up = [[0] * 3 for i in range(n)]
down = [[0] * 3 for i in range(n)]
for i in range(n):
	up[i][0] = k[i] * x1 + b[i]
	up[i][1] = k[i] * x2 + b[i]
	up[i][2] = i
	down[i][0] = k[i] * x2 + b[i]
	down[i][1] = k[i] * x1 + b[i]
	down[i][2] = i
up.sort()
down.sort()
for i in range(n):
	if up[i][2] != down[i][2]:
		print('yes')
		sys.exit()
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')


a = []
n = int(input())
(x1, x2) = map(int, input().split())
for i in range(n):
	(k, b) = map(int, input().split())
	(c, d) = (k * x1 + b, k * x2 + b)
	a.append([c, d])

def f(a):
	return a[1]
a.sort()
for i in range(1, len(a)):
	if a[i][0] > a[i - 1][0] and a[i][1] < a[i - 1][1]:
		print('Yes')
		quit()
print('No')


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')


def getSegment(line, x1, x2):
	x1 += 1e-09
	x2 -= 1e-09
	(k, b) = line
	P1 = (x1, k * x1 + b)
	P2 = (x2, k * x2 + b)
	return (P1, P2)

def doesIntersect(segment1, segment2):
	(P11, P12) = segment1
	(P21, P22) = segment2
	return (P11 < P21) != (P12 < P22)
n = int(input())
data = []
(x1, x2) = list(map(int, input().split()))
for i in range(n):
	(k, b) = list(map(int, input().split()))
	data.append((k, b))
segments = [getSegment(line, x1, x2) for line in data]
segments.sort()
check_intersections = map(doesIntersect, segments, segments[1:])
if 1 in check_intersections:
	print('YES')
else:
	print('NO')


n = int(input())
(x1, x2) = map(int, input().split())
left = [[0, 0, 0]] * n
right = [[0, 0, 0]] * n
for i in range(n):
	(k, b) = map(int, input().split())
	left[i] = [k * x1 + b, k, i]
	right[i] = [k * x2 + b, -k, i]
left.sort()
right.sort()
ans = 'No'
for i in range(n):
	if left[i][2] != right[i][2]:
		ans = 'Yes'
print(ans)


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
import time
import math
from collections import defaultdict
from functools import lru_cache
INF = 10 ** 18 + 3
EPS = 1e-10
MAX_CACHE = 10 ** 9

def time_it(function, output=sys.stderr):

	def wrapped(*args, **kwargs):
		start = time.time()
		res = function(*args, **kwargs)
		elapsed_time = time.time() - start
		print('"%s" took %f ms' % (function.__name__, elapsed_time * 1000), file=output)
		return res
	return wrapped

@time_it
def main():
	n = int(input())
	(x1, x2) = map(int, input().split())
	funcs = []
	for _ in range(n):
		(k, b) = map(int, input().split())
		funcs.append(lambda x, k=k, b=b: k * x + b)
	comp = lambda x: lambda i: funcs[i](x)
	sorted1 = sorted(range(n), key=comp(x1 + EPS))
	sorted2 = sorted(range(n), key=comp(x2 - EPS))
	print('Yes' if sorted1 != sorted2 else 'No')

def set_input(file):
	global input
	input = lambda : file.readline().strip()

def set_output(file):
	global print
	local_print = print

	def print(*args, **kwargs):
		kwargs['file'] = kwargs.get('file', file)
		return local_print(*args, **kwargs)
set_input(open('input.txt', 'r') if 'MINE' in sys.argv else sys.stdin)
set_output(sys.stdout)
main()


n = int(input())
(x1, x2) = map(int, input().split())
res = [0] * n
for i in range(n):
	(k, b) = map(int, input().split())
	res[i] = [k * x1 + b, k * x2 + b]
res.sort()
for i in range(n):
	(res[i][0], res[i][1]) = (res[i][1], res[i][0])
st = -1
for i in range(n):
	if i + 1 != n and res[i] == res[i + 1] and (st == -1):
		st = i
	if st != -1 and res[i] != res[i - 1]:
		res[st:i].sort()
		st = -1
for i in range(1, n):
	if res[i][0] < res[i - 1][0]:
		print('yes')
		break
else:
	print('no')


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')


n = int(input())
b = [0 for i in range(n)]
k = [0 for i in range(n)]
(x1, x2) = (int(x) for x in input().split())
for i in range(n):
	(k[i], b[i]) = (int(x) for x in input().split())
y1 = [x1 * k[i] + b[i] for i in range(n)]
y2 = [x2 * k[i] + b[i] for i in range(n)]
y3 = [(y1[i], y2[i], i) for i in range(n)]
y3.sort()
r1 = [0 for i in range(n)]
for i in range(n):
	r1[y3[i][-1]] = i
y4 = [(y2[i], r1[i], i) for i in range(n)]
y4.sort()
r2 = [0 for i in range(n)]
for i in range(n):
	r2[y4[i][-1]] = i
ans = 0
for i in range(n):
	if r1[i] < r2[i]:
		ans = 1
		break
if ans:
	print('Yes')
else:
	print('No')