Polycarp has recently got himself a new job. He now earns so much that his old wallet can't even store all the money he has.

Berland bills somehow come in lots of different sizes. However, all of them are shaped as rectangles (possibly squares). All wallets are also produced in form of rectangles (possibly squares).

A bill $x \times y$ fits into some wallet $h \times w$ if either $x \le h$ and $y \le w$ or $y \le h$ and $x \le w$. Bills can overlap with each other in a wallet and an infinite amount of bills can fit into a wallet. That implies that all the bills Polycarp currently have fit into a wallet if every single one of them fits into it independently of the others.

Now you are asked to perform the queries of two types:

  $+~x~y$ — Polycarp earns a bill of size $x \times y$;  $?~h~w$ — Polycarp wants to check if all the bills he has earned to this moment fit into a wallet of size $h \times w$. 

It is guaranteed that there is at least one query of type $1$ before the first query of type $2$ and that there is at least one query of type $2$ in the input data.

For each query of type $2$ print "YES" if all the bills he has earned to this moment fit into a wallet of given size. Print "NO" otherwise.


-----Input-----

The first line contains a single integer $n$ ($2 \le n \le 5 \cdot 10^5$) — the number of queries.

Each of the next $n$ lines contains a query of one of these two types:

  $+~x~y$ ($1 \le x, y \le 10^9$) — Polycarp earns a bill of size $x \times y$;  $?~h~w$ ($1 \le h, w \le 10^9$) — Polycarp wants to check if all the bills he has earned to this moment fit into a wallet of size $h \times w$. 

It is guaranteed that there is at least one query of type $1$ before the first query of type $2$ and that there is at least one query of type $2$ in the input data.


-----Output-----

For each query of type $2$ print "YES" if all the bills he has earned to this moment fit into a wallet of given size. Print "NO" otherwise.


-----Example-----
Input
9
+ 3 2
+ 2 3
? 1 20
? 3 3
? 2 3
+ 1 5
? 10 10
? 1 5
+ 1 1

Output
NO
YES
YES
YES
NO



-----Note-----

The queries of type $2$ of the example:

  Neither bill fits;  Both bills fit (just checking that you got that bills can overlap);  Both bills fit (both bills are actually the same);  All bills fit (too much of free space in a wallet is not a problem);  Only bill $1 \times 5$ fit (all the others don't, thus it's "NO").

Difficulty: MEDIUM
Tags: Implementation

Starter code:

Solutions:
import sys
from atexit import register
from io import StringIO as stream

def fast_io():
	sys.stdin = stream(sys.stdin.read())
	sys.stdout = stream()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline()

def main():
	(h, w) = (0, 0)
	for tc in range(int(input())):
		(t, x, y) = input().split()
		x = int(x)
		y = int(y)
		if x < y:
			(x, y) = (y, x)
		if t == '+':
			h = max(h, x)
			w = max(w, y)
		elif t == '?':
			if x >= h and y >= w:
				print('YES')
			else:
				print('NO')
fast_io()
main()


n = int(input())
query = []
for i in range(n):
	query.append(input().split())
mini = 0
maxi = 0
for q in query:
	if q[0] == '+':
		maior = max(int(q[1]), int(q[2]))
		menor = min(int(q[1]), int(q[2]))
		if menor > mini:
			mini = menor
		if maior > maxi:
			maxi = maior
	else:
		maior = max(int(q[1]), int(q[2]))
		menor = min(int(q[1]), int(q[2]))
		if maior >= maxi and menor >= mini:
			print('YES')
		else:
			print('NO')


mima = -10 ** 9
mami = -10 ** 9
asan = []
for _ in range(int(input())):
	(c, x, y) = input().split()
	(x, y) = (int(x), int(y))
	(x, y) = (min(x, y), max(x, y))
	if c == '+':
		mima = max(mima, x)
		mami = max(mami, y)
	elif x >= mima and y >= mami:
		asan.append('yes')
	else:
		asan.append('no')
print('\n'.join(asan))


import sys
amount = int(input())
max_1 = -1
max_2 = -1
ans = ''
for i in range(amount):
	inputs = [s for s in input().split()]
	if inputs[0] == '+':
		if max_1 < min(int(inputs[1]), int(inputs[2])):
			max_1 = min(int(inputs[1]), int(inputs[2]))
		if max_2 < max(int(inputs[1]), int(inputs[2])):
			max_2 = max(int(inputs[1]), int(inputs[2]))
	elif max_1 <= int(inputs[1]) and max_2 <= int(inputs[2]) or (max_1 <= int(inputs[2]) and max_2 <= int(inputs[1])):
		ans += 'YES\n'
	else:
		ans += 'NO\n'
print(ans)


from sys import stdin, stdout
Q = int(input())
mini = 0
maxi = 0
for i in range(Q):
	arr = [x for x in stdin.readline().split()]
	arr[1] = int(arr[1])
	arr[2] = int(arr[2])
	if arr[0] == '+':
		mini = max(mini, min(arr[1], arr[2]))
		maxi = max(maxi, max(arr[1], arr[2]))
	elif arr[0] == '?':
		if min(arr[1], arr[2]) >= mini and max(arr[1], arr[2]) >= maxi:
			print('YES')
		else:
			print('NO')


import sys
n = int(sys.stdin.readline())
(mdk, msk) = (0, 0)
for i in range(n):
	s = [z for z in sys.stdin.readline().split()]
	(a, b) = (int(s[1]), int(s[2]))
	(a, b) = (max((a, b)), min((a, b)))
	if s[0] == '+':
		mdk = max(mdk, a)
		msk = max(msk, b)
	else:
		print('YES' if a >= mdk and b >= msk else 'NO')


input = __import__('sys').stdin.readline
ma1 = 0
ma2 = 0
for _ in range(int(input())):
	(a, b, c) = map(str, input().split())
	b = int(b)
	c = int(c)
	if a == '+':
		ma1 = max(ma1, b, c)
		ma2 = max(ma2, min(b, c))
	elif ma1 <= b and ma2 <= c:
		print('YES')
	elif ma1 <= c and ma2 <= b:
		print('YES')
	else:
		print('NO')


import sys
import math
from collections import defaultdict, deque
input = sys.stdin.readline

def inar():
	return [int(el) for el in input().split()]

def main():
	(low, high) = (0, 0)
	t = int(input())
	for _ in range(t):
		(op, x, y) = input().strip().split()
		x = int(x)
		y = int(y)
		(x, y) = (min(x, y), max(x, y))
		if op == '+':
			low = max(low, x)
			high = max(high, y)
		elif low <= x and high <= y:
			print('YES')
		else:
			print('NO')
main()


n = int(input())
xMax = 0
yMax = 0
string = ''
for _ in range(n):
	query = input().split()
	if query[0] == '+':
		x = min(int(query[1]), int(query[2]))
		y = max(int(query[1]), int(query[2]))
		if x > xMax:
			xMax = x
		if y > yMax:
			yMax = y
	else:
		h = int(query[1])
		w = int(query[2])
		if h >= xMax and w >= yMax or (h >= yMax and w >= xMax):
			string += 'YES\n'
		else:
			string += 'NO\n'
print(string)


from sys import stdin, stdout
(x, y) = (0, 0)
ans = []
for _ in range(int(input())):
	(t, a, b) = stdin.readline().strip('\n').split()
	if t == '+':
		(a, b) = (int(a), int(b))
		if a > b:
			(a, b) = (b, a)
		x = max(x, a)
		y = max(y, b)
	else:
		(w, h) = (int(a), int(b))
		if w > h:
			(w, h) = (h, w)
		if x <= w and y <= h:
			ans.append('YES')
		else:
			ans.append('NO')
print(*ans, sep='\n')


n_queries = int(input())
min_x = -1
max_x = -1
min_y = -1
max_y = -1
ans = []
for n in range(n_queries):
	(query_type, x, y) = input().split()
	x = int(x)
	y = int(y)
	if x < y:
		temp = x
		x = y
		y = temp
	if query_type == '+':
		if max_x < x:
			max_x = x
		if max_y < y:
			max_y = y
	elif max_x <= x and max_y <= y:
		ans.append('YES')
	else:
		ans.append('NO')
for answer in range(len(ans)):
	print(ans[answer])


import io, os
input = iter(os.read(0, os.fstat(0).st_size).splitlines()).__next__
mx = my = 0
out = []
for i in range(int(input())):
	(s, x, y) = input().split()
	(x, y) = (int(x), int(y))
	if x > y:
		(x, y) = (y, x)
	if s == b'+':
		mx = max(mx, x)
		my = max(my, y)
	else:
		out.append('YES' if x >= mx and y >= my else 'NO')
print('\n'.join(out))


n = int(input())
ma = 0
mb = 0
s = ''
for i in range(n):
	a = input().split()
	a[1] = int(a[1])
	a[2] = int(a[2])
	if a[2] < a[1]:
		(a[1], a[2]) = (a[2], a[1])
	if a[0] == '+':
		ma = max(ma, a[1])
		mb = max(mb, a[2])
	elif a[1] >= ma and a[2] >= mb:
		s += 'YES\n'
	else:
		s += 'NO\n'
print(s)


N = int(input())
(H, W) = (0, 0)
Ans = []
for i in range(N):
	(op, x, y) = input().split()
	(x, y) = (min(int(x), int(y)), max(int(x), int(y)))
	if op == '+':
		H = max(x, H)
		W = max(y, W)
	elif H <= x and W <= y:
		Ans += ['YES']
	else:
		Ans += ['NO']
print('\n'.join(Ans))


import sys
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline()

def main():
	(h, w) = (0, 0)
	for tc in range(int(input())):
		(t, x, y) = input().split()
		x = int(x)
		y = int(y)
		if x < y:
			(x, y) = (y, x)
		if t == '+':
			h = max(h, x)
			w = max(w, y)
		elif t == '?':
			if x >= h and y >= w:
				print('YES')
			else:
				print('NO')
main()


from sys import stdin
input = stdin.readline
mxx = 0
mxy = 0
for _ in range(int(input())):
	(s, a, b) = input().split()
	a = int(a)
	b = int(b)
	if s == '+':
		(x, y) = (min(a, b), max(a, b))
		mxx = max(mxx, x)
		mxy = max(mxy, y)
		if mxx > mxy:
			tmp = mxy
			mxy = mxx
			mxx = tmp
	else:
		(h, w) = (min(a, b), max(a, b))
		print('YES' if mxx <= h and mxy <= w else 'NO')


num = int(input())
log = []
for x in range(num):
	log.append(input().split())
a = 0
b = min(int(log[0][2]), int(log[0][1]))
for y in log:
	first = int(y[1])
	second = int(y[2])
	if y[0] == '+':
		a = max(first, second, a)
		temp = min(first, second)
		b = max(temp, b)
		continue
	elif (first < a or second < b) and (first < b or second < a):
		print('NO')
	else:
		print('Yes')


(x, y) = (0, 0)
res = ''
n = int(input())
for _ in range(n):
	q = [i for i in input().split()]
	q[1] = int(q[1])
	q[2] = int(q[2])
	if q[0] == '+':
		x = max(x, min(q[1], q[2]))
		y = max(y, max(q[1], q[2]))
	elif x <= min(q[1], q[2]) and y <= max(q[1], q[2]):
		res += 'YES\n'
	else:
		res += 'NO\n'
print(res)


n = int(input())
x = y = 0
max_x = max_y = 0
r = ''
c = temp = 0
che = False
for i in range(n):
	c += +1
	s = input().split()
	if s[0] == '+':
		x = int(s[1])
		y = int(s[2])
		x1 = max(x, y)
		y1 = min(x, y)
		if max_y < y1:
			max_y = y1
		if max_x < x1:
			max_x = x1
	else:
		h = int(s[1])
		w = int(s[2])
		if max_x <= h and max_y <= w or (max_y <= h and max_x <= w):
			r += 'YES\n'
		else:
			r += 'NO\n'
print(r)


import sys
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import *
from time import time
from io import StringIO as stream
from atexit import register

def sync_with_stdio(sync=True):
	global input, flush
	if sync:
		flush = sys.stdout.flush
	else:
		sys.stdin = stream(sys.stdin.read())
		input = lambda : sys.stdin.readline().rstrip('\r\n')
		sys.stdout = stream()
		register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
input = sys.stdin.readline
(n,) = I()
w = 0
h = 0
while n:
	n -= 1
	(c, x, y) = input().split()
	x = int(x)
	y = int(y)
	if c == '+':
		if y > x:
			(x, y) = (y, x)
		w = max(w, x)
		h = max(h, y)
	elif x >= w and y >= h or (y >= w and x >= h):
		print('YES')
	else:
		print('NO')


q = int(input())
c = 0
L = []
while q > 0:
	q = q - 1
	(t, a, b) = input().split()
	a = int(a)
	b = int(b)
	if c == 0 and t == '+':
		(mi, ma) = (min(a, b), max(a, b))
		c = 1
	if t == '+':
		mi = max(mi, min(a, b))
		ma = max(ma, max(a, b))
	elif t == '?':
		if min(a, b) >= mi and max(a, b) >= ma:
			L.append('YES')
		else:
			L.append('NO')
print('\n'.join(L))


def I():
	return list(map(int, input().split()))
maxx = 0
maxy = 0
r = ''
for __ in range(int(input())):
	s = input().split()
	(x, y) = (min([int(s[1]), int(s[2])]), max(int(s[1]), int(s[2])))
	if s[0] == '+':
		maxx = max(maxx, x)
		maxy = max(maxy, y)
	else:
		(h, w) = (x, y)
		if h < maxx or w < maxy:
			r += 'NO\n'
		else:
			r += 'YES\n'
print(r)


from sys import stdin, stdout
maxH = maxW = 0
for _ in range(int(stdin.readline())):
	q = stdin.readline().split()
	(h, w) = map(int, q[1:])
	if h > w:
		(h, w) = (w, h)
	if q[0] == '+':
		maxH = max(maxH, h)
		maxW = max(maxW, w)
	else:
		stdout.write('YES\n' if h >= maxH and w >= maxW else 'NO\n')


n = int(input())
(maxa, maxb, res) = (0, 0, [])
for i in range(n):
	(act, x, y) = input().split()
	(x, y) = (min(int(x), int(y)), max(int(x), int(y)))
	if act == '+':
		maxa = max(maxa, x)
		maxb = max(maxb, y)
	else:
		res.append('YES\n' if x >= maxa and y >= maxb else 'NO\n')
print(''.join(res))


n = int(input())
(h, w) = (0, 0)
ans = ''
for i in range(n):
	(op, x, y) = input().split()
	(x, y) = (min(int(x), int(y)), max(int(x), int(y)))
	if op == '+':
		h = max(x, h)
		w = max(y, w)
	elif h <= x and w <= y:
		ans += 'YES\n'
	else:
		ans += 'NO\n'
print(ans)


import os
import sys
from io import BytesIO, IOBase
from collections import defaultdict, deque, Counter, OrderedDict
import threading
MAX = 10 ** 9

def main():
	(h, w) = (0, 0)
	for _ in range(int(input())):
		(a, b, c) = input().split()
		b = int(b)
		c = int(c)
		(x, y) = (min(b, c), max(b, c))
		if a == '+':
			h = max(h, x)
			w = max(w, y)
		elif x >= h and y >= w:
			print('YES')
		else:
			print('NO')
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
n = int(input())
m_x = 0
m_y = 0
lines = sys.stdin.readlines()
for line in lines:
	(s, a, b) = line.split()
	a = int(a)
	b = int(b)
	if s == '+':
		if b > a:
			m_x = max(a, m_x)
			m_y = max(b, m_y)
		else:
			m_x = max(b, m_x)
			m_y = max(a, m_y)
	elif a >= m_x and b >= m_y or (b >= m_x and a >= m_y):
		print('YES')
	else:
		print('NO')


n = int(input())
i = j = 0
ans = ''
for p in range(0, n):
	(q, x, y) = input().split()
	(x, y) = (int(x), int(y))
	if x < y:
		(x, y) = (y, x)
	if q == '+':
		(i, j) = (max(x, i), max(y, j))
	else:
		ans += 'NO\n' if x < i or y < j else 'YES\n'
print(ans)


import itertools
import bisect
import math
from collections import *
import os
import sys
from io import BytesIO, IOBase
ii = lambda : int(input())
lmii = lambda : list(map(int, input().split()))
li = lambda : list(input())
mii = lambda : map(int, input().split())
msi = lambda : map(str, input().split())

def main():
	w = 0
	h = 0
	for _ in ' ' * int(input()):
		s = list(input().split(' '))
		a = int(s[1])
		b = int(s[2])
		aa = min(a, b)
		bb = max(a, b)
		if s[0] == '+':
			w = max(w, aa)
			h = max(h, bb)
		elif w <= aa and h <= bb:
			print('YES')
		else:
			print('NO')
	pass
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()


n = input()
max_x = None
max_y = None
arr = []
inputs = []
for i in range(int(n)):
	_input = input()
	inputs.append(_input)
for _input in inputs:
	_input = _input.split(' ')
	if _input[0] == '+':
		x = int(_input[1])
		y = int(_input[2])
		if x < y:
			temp = x
			x = y
			y = temp
		if max_x is None or max_x < x:
			max_x = x
		if max_y is None or max_y < y:
			max_y = y
	if _input[0] == '?':
		w = int(_input[1])
		h = int(_input[2])
		if w < h:
			temp = w
			w = h
			h = temp
		if max_x <= w and max_y <= h:
			arr.append(f'YES')
		else:
			arr.append(f'NO')
for i in arr:
	print(i)


n = int(input())
s = ''
yes = 'YES\n'
no = 'NO\n'
maxx = 0
maxy = 0
for item in range(n):
	flag = input().split()
	a = int(flag[1])
	b = int(flag[2])
	if a > b:
		(a, b) = (b, a)
	if flag[0] == '+':
		if a > maxx:
			maxx = a
		if b > maxy:
			maxy = b
	elif maxx <= a and maxy <= b:
		s += yes
	else:
		s += no
print(s)


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

def main():
	query_num = int(input())
	(max_x, max_y) = (0, 0)
	for _ in range(query_num):
		(sym, ca, cb) = input().split()
		if sym == '+':
			(x, y) = (int(ca), int(cb))
			if x > y:
				(x, y) = (y, x)
			max_x = max(x, max_x)
			max_y = max(y, max_y)
		elif sym == '?':
			(h, w) = (int(ca), int(cb))
			if h > w:
				(h, w) = (w, h)
			if h >= max_x and w >= max_y:
				print('YES')
			else:
				print('NO')
main()


from collections import Counter, OrderedDict
from itertools import permutations as perm
from fractions import Fraction
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
(q,) = gil()
(x, y) = (-inf, -inf)
for _ in range(q):
	q = gl()
	if q[0] == '+':
		(x_, y_) = (int(q[1]), int(q[2]))
		x = max(x, min(x_, y_))
		y = max(y, max(x_, y_))
	else:
		q[1] = int(q[1])
		q[2] = int(q[2])
		print('YES' if x <= min(q[1:]) and y <= max(q[1:]) else 'NO')


import sys
n = int(sys.stdin.readline())
mxX = 0
mxY = 0
for i in range(n):
	inp = str(sys.stdin.readline()).split()
	s = inp[0]
	x = int(inp[1])
	y = int(inp[2])
	if s == '+':
		if x < y:
			(x, y) = (y, x)
		if x > mxX:
			mxX = x
		if y > mxY:
			mxY = y
	if s == '?':
		if x >= mxX and y >= mxY or (y >= mxX and x >= mxY):
			print('YES')
		else:
			print('NO')


n = m = 0
r = ''
for _ in [0] * int(input()):
	s = input().split()
	(x, y) = map(int, s[1:])
	if x > y:
		(x, y) = (y, x)
	if s[0] < '?':
		m = max(m, x)
		n = max(n, y)
	else:
		r += 'YNEOS\n\n'[x < m or y < n::2]
print(r)


n = int(input())
min1 = 0
min2 = 0
outs = []
for i in range(n):
	(s, x, y) = input().rstrip().split()
	x = int(x)
	y = int(y)
	w1 = min(x, y)
	w2 = max(x, y)
	if s == '+':
		if w1 >= min1:
			min1 = w1
		if w2 >= min2:
			min2 = w2
	if s == '?':
		if w1 >= min1 and w2 >= min2:
			outs.append('YES')
		else:
			outs.append('NO')
print(*outs)


def ajustar(h, w, x, y):
	return x <= h and y <= w or (y <= h and x <= w)
n = int(input())
arr_r = []
mx = -1
my = -1
for i in range(n):
	entrada = input().split()
	t = entrada[0]
	x = int(entrada[1])
	y = int(entrada[2])
	if t == '+':
		if x < y:
			temp = x
			x = y
			y = temp
		mx = max(mx, x)
		my = max(my, y)
	elif t == '?':
		result = 'YES' if ajustar(x, y, mx, my) else 'NO'
		arr_r.append(result)
for r in arr_r:
	print(r)


(max_a, max_b) = (0, 0)
ans = []
for i in range(int(input())):
	vn = input().split()
	x = int(vn[1])
	y = int(vn[2])
	if x < y:
		a = x
		x -= x
		x += y
		y -= y
		y += a
	if vn[0] == '+':
		max_a = max(max_a, x)
		max_b = max(max_b, y)
	elif max_a <= x and max_b <= y:
		ans.append('YES')
	else:
		ans.append('NO')
print('\n'.join(ans))


QTYPE = 0
X = 0
Y = 1
H = 1
W = 2

def main():
	buf = input()
	n = int(buf)
	query = []
	for i in range(n):
		buf = input()
		buflist = buf.split()
		if int(buflist[1]) > int(buflist[2]):
			query.append([buflist[0], int(buflist[1]), int(buflist[2])])
		else:
			query.append([buflist[0], int(buflist[2]), int(buflist[1])])
	bill_size = [query[0][H], query[0][W]]
	for i in range(n):
		if query[i][QTYPE] == '+':
			bill_size = [max(bill_size[X], query[i][H]), max(bill_size[Y], query[i][W])]
		elif bill_size[X] <= query[i][H] and bill_size[Y] <= query[i][W]:
			print('YES')
		else:
			print('NO')
main()


import sys
q = int(input())
mi = 0
ma = 0
for j in range(q):
	(a, b, c) = map(str, sys.stdin.readline().split())
	r = int(b)
	s = int(c)
	if a == '+':
		mi = max(mi, min(r, s))
		ma = max(ma, max(r, s))
	else:
		p = min(r, s)
		q = max(r, s)
		if mi <= p and ma <= q:
			print('YES')
		else:
			print('NO')


import sys
input = sys.stdin.readline
n = int(input())
a = [list(map(str, input().split())) for _ in range(n)]
tate = 0
yoko = 0
for i in range(n):
	if a[i][0] == '+':
		b = [int(a[i][1]), int(a[i][2])]
		b.sort()
		if tate < b[0]:
			tate = b[0]
		if yoko < b[1]:
			yoko = b[1]
	elif a[i][0] == '?':
		b = [int(a[i][1]), int(a[i][2])]
		b.sort()
		if tate <= b[0] and yoko <= b[1]:
			print('YES')
		else:
			print('NO')


import sys
k = 0
(max_x, max_y) = (0, 0)
for line in sys.stdin:
	if k == 0:
		n = int(line)
		k += 1
	else:
		(q, x, y) = map(str, line.split())
		if q == '+':
			(x, y) = (int(x), int(y))
			max_x = max(max_x, min(x, y))
			max_y = max(max_y, max(x, y))
		else:
			(h, w) = (int(x), int(y))
			if min(max_x, max_y) <= min(h, w) and max(max_x, max_y) <= max(h, w):
				print('YES')
			else:
				print('NO')


import sys
a = 0
b = 0
for _ in range(int(input())):
	(d, n, m) = sys.stdin.readline().split()
	n = int(n)
	m = int(m)
	if d == '+':
		a = max(min(m, n), a)
		b = max(max(m, n), b)
	elif a <= n and b <= m or (b <= n and a <= m):
		print('YES')
	else:
		print('NO')


ansarr = []
n = int(input())
val1 = [0, 0]
for i in range(n):
	(a, b, c) = map(str, input().split())
	if a == '+':
		b = int(b)
		c = int(c)
		if b >= c:
			val1[0] = max(val1[0], b)
			val1[1] = max(val1[1], c)
		else:
			val1[0] = max(val1[0], c)
			val1[1] = max(val1[1], b)
	else:
		b = int(b)
		c = int(c)
		if val1[0] <= b and val1[1] <= c or (val1[0] <= c and val1[1] <= b):
			ansarr.append('YES')
		else:
			ansarr.append('NO')
print(*ansarr)


import sys
from array import array
import typing as Tp

def input():
	return sys.stdin.buffer.readline().decode('utf-8')

def main():
	n = int(input())
	(mx, my) = (0, 0)
	ans = []
	for (qtype, x, y) in (input().split() for _ in range(n)):
		(x, y) = (int(x), int(y))
		if x > y:
			(x, y) = (y, x)
		if qtype == '+':
			(mx, my) = (max(mx, x), max(my, y))
		else:
			ans.append('YES' if mx <= x and my <= y else 'NO')
	sys.stdout.buffer.write(('\n'.join(ans) + '\n').encode('utf-8'))
main()


import os, sys
from io import BytesIO, IOBase

def main():
	(ma1, ma2) = (0, 0)
	for _ in range(rint()):
		(ch, l, r) = rstrs()
		(l, r) = (int(l), int(r))
		if ch == '?':
			print('YES' if any((ma1 <= l and ma2 <= r, ma2 <= l and ma1 <= r)) else 'NO')
		else:
			(ma1, ma2) = (max(min(l, r), ma1), max(l, r, ma2))

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')
BUFSIZE = 8192
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
rstr = lambda : input().strip()
rstrs = lambda : [str(x) for x in input().split()]
rstr_2d = lambda n: [rstr() for _ in range(n)]
rint = lambda : int(input())
rints = lambda : [int(x) for x in input().split()]
rint_2d = lambda n: [rint() for _ in range(n)]
rints_2d = lambda n: [rints() for _ in range(n)]
ceil1 = lambda a, b: (a + b - 1) // b
main()


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
n = int(input())
m = [0, 0]
ans = []
for i in range(n):
	inp = input().split()
	if inp[0] == '+':
		wal = sorted([int(inp[1]), int(inp[2])])
		if wal[0] > m[0]:
			m[0] = wal[0]
		if wal[1] > m[1]:
			m[1] = wal[1]
		m.sort()
	else:
		kos = sorted([int(inp[1]), int(inp[2])])
		if kos[0] >= m[0] and kos[1] >= m[1]:
			ans.append(True)
		else:
			ans.append(False)
for a in ans:
	print('YES') if a else print('NO')


import sys
n = int(input())
w = 0
h = 0
cmds = sys.stdin.read().splitlines()
for cmd in cmds:
	cmd = cmd.split()
	new_w = int(cmd[1])
	new_h = int(cmd[2])
	if new_w < new_h:
		(new_w, new_h) = (new_h, new_w)
	if cmd[0] == '+':
		w = max(w, new_w)
		h = max(h, new_h)
	else:
		print('YES' if new_w >= w and new_h >= h else 'NO')


import sys
lax = -10 ** 9
lay = -10 ** 9
for _ in range(int(input())):
	(sign, x, y) = map(str, sys.stdin.readline().split())
	x = int(x)
	y = int(y)
	if sign == '+':
		if y > x:
			t = x
			x = y
			y = t
		lax = max(x, lax)
		lay = max(y, lay)
	else:
		if y > x:
			t = x
			x = y
			y = t
		if lax <= x and lay <= y:
			print('YES')
		else:
			print('NO')


from sys import stdin, stdout
from math import *
from heapq import *
from collections import *

def main():
	n = int(stdin.readline())
	maxx = 0
	maxy = 0
	for _ in range(n):
		query = stdin.readline().split()
		if query[0] == '+':
			x = int(query[1])
			y = int(query[2])
			if x > y:
				(x, y) = (y, x)
			maxx = max(maxx, x)
			maxy = max(maxy, y)
		else:
			h = int(query[1])
			w = int(query[2])
			if h > w:
				(h, w) = (w, h)
			res = 'NO'
			if maxx <= h and maxy <= w:
				res = 'YES'
			stdout.write(res + '\n')
	return 0
main()


n = int(input())
mini = -1
maxi = -1
ans_arr = []
for t in range(n):
	[a, b, c] = input().split()
	b = int(b)
	c = int(c)
	if a == '+':
		v1 = min(b, c)
		v2 = max(b, c)
		if v1 > mini:
			mini = v1
		if v2 > maxi:
			maxi = v2
	elif mini <= b and maxi <= c or (mini <= c and maxi <= b):
		ans_arr.append('YES')
	else:
		ans_arr.append('NO')
for k in range(len(ans_arr)):
	print(ans_arr[k])


n = int(input())
mx = 0
my = 0
s = ''
for i in range(n):
	a = input().split()
	a[1] = int(a[1])
	a[2] = int(a[2])
	if a[2] < a[1]:
		(a[1], a[2]) = (a[2], a[1])
	if a[0] == '+':
		mx = max(mx, a[1])
		my = max(my, a[2])
	elif a[1] >= mx and a[2] >= my:
		s += 'YES' + '\n'
	else:
		s += 'NO' + '\n'
print(s)


import os
import sys
from io import BytesIO, IOBase

def main():
	maxx = 0
	maxy = 0
	r = ''
	for __ in range(int(input())):
		s = input().split()
		(x, y) = (min([int(s[1]), int(s[2])]), max(int(s[1]), int(s[2])))
		if s[0] == '+':
			maxx = max(maxx, x)
			maxy = max(maxy, y)
		else:
			(h, w) = (x, y)
			if h < maxx or w < maxy:
				print('NO')
			else:
				print('YES')
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')

def I():
	return list(map(int, input().split()))
main()


import sys
input = sys.stdin.readline
n = int(input())
a = input().split()
if int(a[1]) > int(a[2]):
	c = a[2]
	a[2] = a[1]
	a[1] = c
l = int(a[1])
r = int(a[2])
for i in range(1, n):
	a = input().split()
	if a[0] == '+':
		if int(a[1]) > int(a[2]):
			c = a[2]
			a[2] = a[1]
			a[1] = c
		if int(a[1]) > l:
			l = int(a[1])
		if int(a[2]) > r:
			r = int(a[2])
	elif int(a[1]) >= l and int(a[2]) >= r:
		print('YES')
	elif int(a[1]) >= r and int(a[2]) >= l:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
x = y = 0
for _ in range(int(input())):
	s = list(stdin.readline().split())
	if s[0] == '+':
		m = [int(s[1]), int(s[2])]
		m.sort()
		x = max(x, m[0])
		y = max(y, m[1])
	else:
		m = [int(s[1]), int(s[2])]
		m.sort()
		if m[0] >= x and m[1] >= y:
			stdout.write('YES' + '\n')
		else:
			stdout.write('NO' + '\n')


T = int(input())
x = 0
y = 0
uu = []
for _ in range(T):
	(p, a, b) = input().split()
	a = int(a)
	b = int(b)
	if p == '+':
		x = max(x, max(a, b))
		y = max(y, min(a, b))
	elif max(a, b) >= x and min(a, b) >= y:
		uu.append('YES')
	else:
		uu.append('NO')
print('\n'.join(uu))


import sys
import bisect
input = sys.stdin.readline
t = 1
mod = 10 ** 9 + 7
for _ in range(t):
	n = int(input())
	l = []
	for i in range(n):
		x = input()
		if x[0] == '+':
			x = list(map(int, x[2:].split()))
			if len(l) == 0:
				l.append([[x[0], x[1]], [x[1], x[0]]])
			else:
				l1 = []
				maxi = max(l[-1][0][0], l[-1][1][0], max(x[0], x[1]))
				mini = min(x[0], x[1])
				mini = max(min(l[-1][0][0], l[-1][1][0]), mini)
				l.append([[maxi, mini], [mini, maxi]])
		else:
			x = list(map(int, x[2:].split()))
			if l[-1][0][0] <= x[0] and l[-1][0][1] <= x[1]:
				print('YES')
			elif l[-1][1][0] <= x[0] and l[-1][1][1] <= x[1]:
				print('YES')
			else:
				print('NO')


max_x = 0
max_y = 0
s = ''
for _ in range(int(input())):
	i = input().split()
	y = max(int(i[1]), int(i[2]))
	x = min(int(i[1]), int(i[2]))
	if i[0] == '?':
		if x < max_x or y < max_y:
			s += 'NO\n'
		else:
			s += 'YES\n'
	else:
		max_x = max(max_x, x)
		max_y = max(max_y, y)
print(s[:-1])


n = int(input())
stx = 0
sty = 0
r = ''
for i in range(n):
	(t, x, y) = input().split()
	x = int(x)
	y = int(y)
	if x > y:
		(x, y) = (y, x)
	if t < '?':
		stx = max(stx, x)
		sty = max(sty, y)
	else:
		r += 'YNeos\n\n'[x < stx or y < sty::2]
print(r)


import sys
input = sys.stdin.readline
N = int(input())
a = -1
b = -1
for i in range(N):
	(t, x, y) = input().split()
	(x, y) = (int(x), int(y))
	if t == '+':
		a = max(a, min(x, y))
		b = max(b, max(x, y))
	else:
		h = min(x, y)
		w = max(x, y)
		if a <= h and b <= w:
			print('YES')
		else:
			print('NO')


m = int(input())
x = 0
y = 0
l = []
for _ in range(m):
	(c, i, j) = input().split()
	if c == '+':
		x = max(max(int(i), int(j)), x)
		y = max(min(int(i), int(j)), y)
	elif max(int(i), int(j)) >= x and min(int(i), int(j)) >= y:
		l.append('YES')
	else:
		l.append('NO')
print('\n'.join(l))


n = int(input())
c = [0, 0]
ans = []
for i in range(n):
	(minx, miny) = (c[0], c[1])
	(v, x, y) = input().split()
	(x, y) = (int(x), int(y))
	(x, y) = (max(x, y), min(x, y))
	if v == '+':
		if not (x <= minx and y <= miny or (x <= miny and y <= minx)):
			if x > minx:
				if y > minx:
					minx = y
					if x > miny:
						miny = x
				else:
					minx = x
					if y > miny:
						miny = y
			elif y > miny:
				miny = y
	elif x >= minx and y >= miny or (x >= miny and y >= minx):
		ans.append('YES')
	else:
		ans.append('NO')
	c = sorted([minx, miny], reverse=True)
print('\n'.join(ans))


import sys
input = sys.stdin.readline
n = int(input())
(a, b) = (0, 0)
for _ in range(n):
	(com, n1, n2) = input().split()
	(n1, n2) = (int(n1), int(n2))
	(n1, n2) = (min(n1, n2), max(n1, n2))
	if com == '+':
		(a, b) = (max(a, n1), max(b, n2))
	elif com == '?':
		if n1 >= a and n2 >= b:
			print('YES')
		else:
			print('NO')


import sys
from collections import defaultdict as dd
input = sys.stdin.readline
n = int(input())
x = 0
y = 0
h = 0
w = 0
m1 = 0
m2 = 0
for i in range(n):
	l = list(map(str, input().split()))
	x = int(l[1])
	y = int(l[2])
	if x > y:
		(x, y) = (y, x)
	if l[0] == '+':
		m1 = max(x, m1)
		m2 = max(y, m2)
	elif x >= m1 and y >= m2:
		print('YES')
	else:
		print('NO')


n = int(input())
queries = list()
maxX = 0
maxY = 0
for i in range(n):
	aux = input().split(' ')
	aux[1] = int(aux[1])
	aux[2] = int(aux[2])
	queries.append(aux)
for query in queries:
	if query[1] > query[2]:
		aux = query[1]
		query[1] = query[2]
		query[2] = aux
	if query[0] == '+':
		maxX = max(maxX, query[1])
		maxY = max(maxY, query[2])
	elif query[1] >= maxX and query[2] >= maxY:
		print('YES')
	elif query[2] >= maxX and query[1] >= maxY:
		print('YES')
	else:
		print('NO')


n = int(input())
m = [0, 0]
ans = []
for i in range(n):
	inp = input().split()
	if inp[0] == '+':
		wal = sorted([int(inp[1]), int(inp[2])])
		if wal[0] > m[0]:
			m[0] = wal[0]
		if wal[1] > m[1]:
			m[1] = wal[1]
		m.sort()
	else:
		kos = sorted([int(inp[1]), int(inp[2])])
		if kos[0] >= m[0] and kos[1] >= m[1]:
			ans.append(True)
		else:
			ans.append(False)
for a in ans:
	print('YES') if a else print('NO')


import sys
input = sys.stdin.readline
n = int(input())
mi = -1
ma = -1
for i in range(n):
	a = input().split()
	b = int(a[1])
	c = int(a[2])
	if b > c:
		(b, c) = (c, b)
	if a[0] == '+':
		mi = max(b, mi)
		ma = max(c, ma)
	elif a[0] == '?':
		if mi <= b and ma <= c:
			print('YES')
		else:
			print('NO')


import sys
m1 = 0
m2 = 0
for _ in range(int(input())):
	(d, h, w) = sys.stdin.readline().split()
	(h, w) = (int(h), int(w))
	if d == '+':
		m1 = max(min(h, w), m1)
		m2 = max(max(h, w), m2)
	else:
		print('YES') if h >= m1 and w >= m2 or (h >= m2 and w >= m1) else print('NO')


import sys
input = sys.stdin.readline
(mx, mi) = (0, 0)
for _ in range(int(input())):
	(k, l, b) = input().split()
	l = int(l)
	b = int(b)
	if k == '+':
		mx = max(mx, max(l, b))
		mi = max(mi, min(l, b))
	elif k == '?':
		if l >= b:
			if l >= mx and b >= mi:
				print('YES')
			else:
				print('NO')
		elif b >= mx and l >= mi:
			print('YES')
		else:
			print('NO')


from sys import stdin, stdout

def test(ma, mb, a, b):
	return ma <= a and mb <= b
n = int(input())
xs = []
(ma, mb) = (0, 0)
res = []
d = {True: 'YES\n', False: 'NO\n'}
for _ in range(n):
	(t, a, b) = stdin.readline().strip().split()
	(a, b) = (int(a), int(b))
	(a, b) = (max(a, b), min(a, b))
	if t == '+':
		(ma, mb) = (max(a, ma), max(b, mb))
	else:
		res.append(d[test(ma, mb, a, b)])
stdout.writelines(res)


n = int(input())
(x, y) = (0, 0)
ans = []
for i in range(n):
	s = input()
	a = s[0]
	(b, c) = map(int, s[2:].split())
	if a == '+':
		if b > c:
			(b, c) = (c, b)
		(x, y) = (max(x, b), max(y, c))
	else:
		if b > c:
			(b, c) = (c, b)
		if x <= b and y <= c:
			ans.append('YES')
		else:
			ans.append('NO')
print('\n'.join(ans))


lMax = 0
rMax = 0
N = int(input())
ans = ''
for i in range(N):
	A = input().split()
	Z = A[0]
	l = int(A[1])
	r = int(A[2])
	if r > l:
		(l, r) = (r, l)
	if Z == '+':
		if l > lMax:
			lMax = l
		if r > rMax:
			rMax = r
	elif rMax <= r and lMax <= l:
		ans += 'YES\n'
	else:
		ans += 'NO\n'
print(ans)


import sys
input = sys.stdin.readline
n = int(input())
minmax = -1
maxmax = -1
first = []
second = []
for i in range(n):
	(typ, a, b) = input().split()
	a = int(a)
	b = int(b)
	if typ == '+':
		if max(a, b) > maxmax:
			maxmax = max(a, b)
			first = [min(a, b), max(a, b)]
		if max(a, b) == maxmax:
			if min(a, b) > first[0]:
				first = [min(a, b), max(a, b)]
		if min(a, b) > minmax:
			minmax = min(a, b)
			second = [min(a, b), max(a, b)]
		if min(a, b) == minmax:
			if min(a, b) > second[0]:
				second = [min(a, b), max(a, b)]
	elif (first[0] <= min(a, b) and first[1] <= max(a, b)) and (second[0] <= min(a, b) and second[1] <= max(a, b)):
		print('YES')
	else:
		print('NO')


from sys import stdin
n = int(stdin.readline().strip())
mx = 0
my = 0
for _ in range(n):
	(symbol, x, y) = list(stdin.readline().split())
	x = int(x)
	y = int(y)
	if x > y:
		(x, y) = (y, x)
	if symbol == '+':
		mx = max(mx, x)
		my = max(my, y)
	elif mx <= x and my <= y:
		print('YES')
	else:
		print('NO')


from sys import stdin
n = int(input())
Min = 0
Max = 0
for _ in range(n):
	(a, b, c) = stdin.readline().split()
	b = int(b)
	c = int(c)
	if a == '+':
		Min = max(Min, min(b, c))
		Max = max(Max, max(b, c))
	elif Min <= min(b, c) and Max <= max(b, c):
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
n = int(input())
mmax = 0
mmin = 0
ans = []
for i in range(n):
	s = input().split()
	(a, b) = (int(s[1]), int(s[2]))
	if a > b:
		mx = a
		mn = b
	else:
		mn = a
		mx = b
	if s[0] == '+':
		if mx > mmax:
			mmax = mx
		if mn > mmin:
			mmin = mn
	elif mx >= mmax and mn >= mmin:
		ans.append('YES')
	else:
		ans.append('NO')
print('\n'.join(ans))


import sys

class Bill:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def getX(self):
		return self.x

	def getY(self):
		return self.y

def main():
	n = int(sys.stdin.readline())
	x_largest = 0
	y_largest = 0
	for _ in range(n):
		(q, x, y) = sys.stdin.readline().split()
		x = int(x)
		y = int(y)
		if y > x:
			(x, y) = (y, x)
		if q == '+':
			if x > x_largest:
				x_largest = x
			if y > y_largest:
				y_largest = y
		else:
			c1 = x >= x_largest and y >= y_largest or (x >= y_largest and y >= x_largest)
			if c1:
				print('YES')
			else:
				print('NO')
main()


from sys import stdin, stdout
n = int(stdin.readline())
mama = -1
mami = -1
for _ in range(n):
	(s, x, y) = map(str, stdin.readline().split())
	x = int(x)
	y = int(y)
	if s == '+':
		ma = max(x, y)
		mi = min(x, y)
		if ma > mama:
			mama = ma
		if mi > mami:
			mami = mi
	else:
		h = max(x, y)
		b = min(x, y)
		if h >= mama and b >= mami:
			stdout.write('YES')
			stdout.write('\n')
		else:
			stdout.write('NO')
			stdout.write('\n')


from sys import stdin, stdout
import cProfile, math
from collections import Counter
from bisect import bisect_left, bisect, bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
import sys, threading
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)
printHeap = str()
memory_constrained = False
P = 10 ** 9 + 7
import sys
sys.setrecursionlimit(10000000)

class Operation:

	def __init__(self, name, function, function_on_equal, neutral_value=0):
		self.name = name
		self.f = function
		self.f_on_equal = function_on_equal

def add_multiple(x, count):
	return x * count

def min_multiple(x, count):
	return x

def max_multiple(x, count):
	return x
sum_operation = Operation('sum', sum, add_multiple, 0)
min_operation = Operation('min', min, min_multiple, 1000000000.0)
max_operation = Operation('max', max, max_multiple, -1000000000.0)

class SegmentTree:

	def __init__(self, array, operations=[sum_operation, min_operation, max_operation]):
		self.array = array
		if type(operations) != list:
			raise TypeError('operations must be a list')
		self.operations = {}
		for op in operations:
			self.operations[op.name] = op
		self.root = SegmentTreeNode(0, len(array) - 1, self)

	def query(self, start, end, operation_name):
		if self.operations.get(operation_name) == None:
			raise Exception('This operation is not available')
		return self.root._query(start, end, self.operations[operation_name])

	def summary(self):
		return self.root.values

	def update(self, position, value):
		self.root._update(position, value)

	def update_range(self, start, end, value):
		self.root._update_range(start, end, value)

	def __repr__(self):
		return self.root.__repr__()

class SegmentTreeNode:

	def __init__(self, start, end, segment_tree):
		self.range = (start, end)
		self.parent_tree = segment_tree
		self.range_value = None
		self.values = {}
		self.left = None
		self.right = None
		if start == end:
			self._sync()
			return
		self.left = SegmentTreeNode(start, start + (end - start) // 2, segment_tree)
		self.right = SegmentTreeNode(start + (end - start) // 2 + 1, end, segment_tree)
		self._sync()

	def _query(self, start, end, operation):
		if end < self.range[0] or start > self.range[1]:
			return None
		if start <= self.range[0] and self.range[1] <= end:
			return self.values[operation.name]
		self._push()
		left_res = self.left._query(start, end, operation) if self.left else None
		right_res = self.right._query(start, end, operation) if self.right else None
		if left_res is None:
			return right_res
		if right_res is None:
			return left_res
		return operation.f([left_res, right_res])

	def _update(self, position, value):
		if position < self.range[0] or position > self.range[1]:
			return
		if position == self.range[0] and self.range[1] == position:
			self.parent_tree.array[position] = value
			self._sync()
			return
		self._push()
		self.left._update(position, value)
		self.right._update(position, value)
		self._sync()

	def _update_range(self, start, end, value):
		if end < self.range[0] or start > self.range[1]:
			return
		if start <= self.range[0] and self.range[1] <= end:
			self.range_value = value
			self._sync()
			return
		self._push()
		self.left._update_range(start, end, value)
		self.right._update_range(start, end, value)
		self._sync()

	def _sync(self):
		if self.range[0] == self.range[1]:
			for op in self.parent_tree.operations.values():
				current_value = self.parent_tree.array[self.range[0]]
				if self.range_value is not None:
					current_value = self.range_value
				self.values[op.name] = op.f([current_value])
		else:
			for op in self.parent_tree.operations.values():
				result = op.f([self.left.values[op.name], self.right.values[op.name]])
				if self.range_value is not None:
					bound_length = self.range[1] - self.range[0] + 1
					result = op.f_on_equal(self.range_value, bound_length)
				self.values[op.name] = result

	def _push(self):
		if self.range_value is None:
			return
		if self.left:
			self.left.range_value = self.range_value
			self.right.range_value = self.range_value
			self.left._sync()
			self.right._sync()
			self.range_value = None

	def __repr__(self):
		ans = '({}, {}): {}\n'.format(self.range[0], self.range[1], self.values)
		if self.left:
			ans += self.left.__repr__()
		if self.right:
			ans += self.right.__repr__()
		return ans

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def primeFactors(n):
	factors = dict()
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		while n % i == 0:
			if i in factors:
				factors[i] += 1
			else:
				factors[i] = 1
			n = n // i
	if n > 2:
		factors[n] = 1
	return factors

def isprime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True

def test_print(*args):
	if testingMode:
		print(args)

def display_list(list1, sep=' '):
	stdout.write(sep.join(map(str, list1)) + '\n')

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))
memory = dict()

def clear_cache():
	nonlocal memory
	memory = dict()

def cached_fn(fn, *args):
	nonlocal memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result
TestCases = False
testingMode = False
optimiseForReccursion = False

def is_Valid(a, b):
	x = min(a, b)
	y = max(a, b)
	diff = y - x
	y = y - 2 * diff
	x = x - 1 * diff
	if x >= 0 and y >= 0 and (x % 3 == 0) and (y % 3 == 0):
		return True
	return False

def main():
	n = get_int()
	(maxi, mini) = (0, 0)
	for _ in range(n):
		k = stdin.readline()
		(x, y, z) = k.split()
		y = int(y)
		z = int(z)
		if x == '+':
			maxi = max(maxi, y, z)
			mini = max(min(y, z), mini)
		else:
			print('YES') if min(y, z) >= mini and max(y, z) >= maxi else print('NO')
if TestCases:
	for _ in range(get_int()):
		cProfile.run('main()') if testingMode else main()
else:
	(cProfile.run('main()') if testingMode else main()) if not optimiseForReccursion else threading.Thread(target=main).start()


a = b = 0
s = ''
for f in range(int(input())):
	i = input().split()
	x = min(int(i[1]), int(i[2]))
	y = max(int(i[1]), int(i[2]))
	if i[0] == '?':
		if x < a or y < b:
			s += 'NO\n'
		else:
			s += 'YES\n'
	else:
		(a, b) = (max(a, x), max(b, y))
print(s[:-1])


q = int(input())
(o, x, y) = input().split()
x = int(x)
y = int(y)
arz = min(x, y)
tool = max(x, y)
ans = ''
for i in range(1, q):
	(o, x, y) = input().split()
	x = int(x)
	y = int(y)
	if x > y:
		(x, y) = (y, x)
	if o == '+':
		if x > arz:
			arz = x
		if y > tool:
			tool = y
	elif x < arz or y < tool:
		ans += 'NO\n'
	else:
		ans += 'YES\n'
print(ans)


import sys
input = sys.stdin.readline
n = int(input())
(tmp, x, y) = input().split()
x = int(x)
y = int(y)
mxB = [max(x, y), min(x, y)]
for i in range(n - 1):
	(tmp, x, y) = input().split()
	x = int(x)
	y = int(y)
	mxx = max(x, y)
	mnn = min(x, y)
	if tmp == '+':
		if mxx > mxB[0]:
			mxB[0] = mxx
		if mnn > mxB[1]:
			mxB[1] = mnn
	else:
		print('YES' if mxx >= mxB[0] and mnn >= mxB[1] else 'NO')


import io, os
input = io.StringIO(os.read(0, os.fstat(0).st_size).decode()).readline
mx = my = 0
out = []
for i in range(int(input())):
	(s, x, y) = input().split()
	(x, y) = (int(x), int(y))
	if x > y:
		(x, y) = (y, x)
	if s == '+':
		mx = max(mx, x)
		my = max(my, y)
	else:
		out.append('YES' if x >= mx and y >= my else 'NO')
os.write(1, '\n'.join(out).encode())


n = int(input())
w_max = 0
h_max = 0
ans = []
for i in range(n):
	q = input().split()
	q[1] = int(q[1])
	q[2] = int(q[2])
	if q[0] == '+':
		w = max(q[1], q[2])
		h = min(q[1], q[2])
		w_max = max(w, w_max)
		h_max = max(h, h_max)
		if w_max < h_max:
			(w_max, h_max) = (h_max, w_max)
	else:
		w = max(q[1], q[2])
		h = min(q[1], q[2])
		if w_max > w or h_max > h:
			ans.append('NO')
		else:
			ans.append('YES')
for i in ans:
	print(i)


input = __import__('sys').stdin.readline
x = 0
y = 0
for _ in range(int(input())):
	(a, b, c) = map(str, input().split())
	(b, c) = (int(b), int(c))
	if a == '+':
		x = max(x, min(b, c))
		y = max(y, max(b, c))
	elif b >= x and c >= y or (c >= x and b >= y):
		print('YES')
	else:
		print('NO')


import io, os
input = io.StringIO(os.read(0, os.fstat(0).st_size).decode()).readline
(maxw, maxh) = (0, 0)
for _ in range(int(input())):
	x = input().split()
	(w, h) = map(int, x[1:])
	if h > w:
		(w, h) = (h, w)
	if x[0] == '+':
		if w > maxw:
			maxw = w
		if h > maxh:
			maxh = h
	else:
		print('YES' if maxw <= w and maxh <= h else 'NO')


import sys
import math
from heapq import *
input = sys.stdin.readline
from functools import cmp_to_key

def pi():
	return int(input())

def pl():
	return int(input(), 16)

def ti():
	return list(map(int, input().split()))

def ts():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
mod = 1000000007
f = []

def fact(n, m):
	global f
	f = [1 for i in range(n + 1)]
	f[0] = 1
	for i in range(1, n + 1):
		f[i] = f[i - 1] * i % m

def fast_mod_exp(a, b, m):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a = a * a % m
		b = b >> 1
	return res

def inverseMod(n, m):
	return fast_mod_exp(n, m - 2, m)

def ncr(n, r, m):
	if n < 0 or r < 0 or r > n:
		return 0
	if r == 0:
		return 1
	return f[n] * inverseMod(f[n - r], m) % m * inverseMod(f[r], m) % m

def main():
	polyNewJob()

def cmp(a, b):
	if a[1] > b[1]:
		return 1
	if a[1] < b[1]:
		return -1
	return 0

def C():
	n = pi()
	(k, c) = ([], [])
	for i in range(n):
		[x, y] = ti()
		k.append(x)
		c.append(y)
	(t, p) = (pi(), ti())
	kc = [[] for i in range(n)]
	for i in range(n):
		kc[i] = [k[i], c[i]]
	kc.sort(key=cmp_to_key(cmp))
	(i, j) = (0, 0)
	d = p[0]
	ans = 0
	while j < n:
		if kc[j][0] < d:
			ans += kc[j][0] * (i + 1) * kc[j][1]
			d -= kc[j][0]
			j += 1
		else:
			ans += d * (i + 1) * kc[j][1]
			kc[j][0] -= d
			i += 1
			if i < t:
				d = p[i] - p[i - 1]
	print(ans)

def polyNewJob():
	n = pi()
	mxH = 0
	mxW = 0
	for i in range(n):
		[a, b, c] = input().split(' ')
		c = c[:-1]
		if a == '+':
			[x, y] = [max(int(b), int(c)), min(int(b), int(c))]
			mxH = max(mxH, x)
			mxW = max(mxW, y)
		elif mxH <= max(int(b), int(c)) and mxW <= min(int(b), int(c)):
			print('YES')
		else:
			print('NO')
main()


import sys
input = sys.stdin.readline
max_small = 0
max_large = 0
for i in range(int(input())):
	tokens = input().split()
	if tokens[0] == '+':
		x = int(tokens[1])
		y = int(tokens[2])
		max_small = max(max_small, min(x, y))
		max_large = max(max_large, x, y)
	elif tokens[0] == '?':
		h = int(tokens[1])
		w = int(tokens[2])
		fits = max_small <= h and max_large <= w or (max_large <= h and max_small <= w)
		print('YES' if fits else 'NO')


import sys
input = sys.stdin.readline
mx = my = 0
out = []
for i in range(int(input())):
	(s, x, y) = input().split()
	(x, y) = (int(x), int(y))
	if x > y:
		(x, y) = (y, x)
	if s == '+':
		mx = max(mx, x)
		my = max(my, y)
	else:
		out.append('YES' if x >= mx and y >= my else 'NO')
print('\n'.join(out))


def main():
	ans = []
	n = int(input())
	max_x = 0
	max_y = 0
	for i in range(n):
		query = list(map(str, input().split()))
		if query[0] == '+':
			(x, y) = (int(query[1]), int(query[2]))
			(x, y) = (min(x, y), max(x, y))
			max_x = max(max_x, x)
			max_y = max(max_y, y)
		else:
			(h, w) = (int(query[1]), int(query[2]))
			(h, w) = (min(h, w), max(h, w))
			if max_x <= h and max_y <= w:
				ans.append('YES')
			else:
				ans.append('NO')
	for i in ans:
		print(i)
main()


import sys
input = sys.stdin.readline
n = int(input())
ma = 0
mi = 0
for i in range(n):
	(s, x, y) = map(str, input().split(' '))
	x = int(x)
	y = int(y)
	if s == '+':
		tma = max(x, y)
		tmi = min(x, y)
		if ma < tma:
			ma = tma
		if mi < tmi:
			mi = tmi
		continue
	wma = max(x, y)
	wmi = min(x, y)
	if ma <= wma and mi <= wmi:
		sys.stdout.write('YES')
	else:
		sys.stdout.write('NO')
	sys.stdout.write('\n')


x = 0
y = 0
ans = []
for i in range(int(input())):
	(c, a, b) = input().split(' ')
	(a, b) = (int(a), int(b))
	if c == '+':
		if a > b:
			temp = a
			a = b
			b = temp
		if a > x:
			x = a
		if b > y:
			y = b
	if c == '?':
		h = a
		w = b
		if h >= x and w >= y:
			ans.append('YES')
		elif h >= y and w >= x:
			ans.append('YES')
		else:
			ans.append('NO')
for item in ans:
	print(item)


from sys import stdin
n = int(stdin.readline())
maxx = -1
maxy = -1
l = stdin.read().strip().splitlines()
for line in l:
	(a, b, c) = line.split()
	if a == '+':
		(x, y) = (min(int(b), int(c)), max(int(b), int(c)))
		maxx = max(maxx, x)
		maxy = max(maxy, y)
	else:
		(x, y) = (min(int(b), int(c)), max(int(b), int(c)))
		if x >= maxx and y >= maxy:
			print('YES')
		else:
			print('NO')


import sys
tc = int(sys.stdin.readline())
x = 0
y = 0
for i in range(tc):
	(p, a, b) = sys.stdin.readline().split()
	a = int(a)
	b = int(b)
	if p == '+':
		x = max(x, max(a, b))
		y = max(y, min(a, b))
	elif max(a, b) >= x and min(a, b) >= y:
		print('YES')
	else:
		print('NO')


import sys
import math
from collections import *
from queue import *
from bisect import *
MOD = int(1000000000.0 + 7)
inf = float('inf')
ninf = float('-inf')
input = sys.stdin.readline

def ii():
	return list(map(int, input().strip().split()))
(l, r) = (0, 0)
for _ in range(int(input())):
	s = input().strip().split()
	a = min(int(s[1]), int(s[2]))
	b = max(int(s[1]), int(s[2]))
	if s[0] == '+':
		l = max(l, a)
		r = max(r, b)
	elif a >= l and b >= r:
		print('YES')
	else:
		print('NO')


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		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 = self.os.read(self._fd, max(self.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 = self.os.read(self._fd, max(self.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:
			self.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')
import collections as col
import math, string

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	bills = []
	(max_min, max_max) = (-10 ** 9, -10 ** 9)
	for n in range(N):
		Q = getStrs()
		if Q[0] == '+':
			(X, Y) = (int(Q[1]), int(Q[2]))
			if X > Y:
				(X, Y) = (Y, X)
			max_min = max(max_min, X)
			max_max = max(max_max, Y)
		else:
			(H, W) = (int(Q[1]), int(Q[2]))
			if H > W:
				(H, W) = (W, H)
			if H < max_min or W < max_max:
				print('NO')
			else:
				print('YES')
	return
solve()


min_x = 0
min_y = 0
ans = ''
for i in range(int(input())):
	(q, _x, _y) = input().split()
	_x = int(_x)
	_y = int(_y)
	x = min(_x, _y)
	y = max(_x, _y)
	if q == '+':
		min_x = max(x, min_x)
		min_y = max(y, min_y)
	elif x >= min_x and y >= min_y:
		ans += 'YES\n'
	else:
		ans += 'NO\n'
print(ans, end='')


import sys
n = int(input())
mx = 0
my = 0
for i in range(n):
	(s, x, y) = sys.stdin.readline().split()
	x = int(x)
	y = int(y)
	if s == '+':
		mx = max(mx, min(x, y))
		my = max(my, max(x, y))
	elif mx <= x and my <= y or (my <= x and mx <= y):
		print('YES')
	else:
		print('NO')


(mi, ma) = (0, 0)
n = int(input())
re = []
for _ in range(n):
	(c, x, y) = input().split()
	(x, y) = (min(int(x), int(y)), max(int(x), int(y)))
	if c == '+':
		mi = max(mi, x)
		ma = max(ma, y)
	elif mi <= x and ma <= y:
		re.append('YES')
	else:
		re.append('NO')
print('\n'.join((i for i in re)))


n = int(input())
arrx = []
minmax = -1
maxmax = -1
first = []
second = []
for i in range(n):
	(typ, a, b) = input().split()
	a = int(a)
	b = int(b)
	if typ == '+':
		if max(a, b) > maxmax:
			maxmax = max(a, b)
			first = [min(a, b), max(a, b)]
		if max(a, b) == maxmax:
			if min(a, b) > first[0]:
				first = [min(a, b), max(a, b)]
		if min(a, b) > minmax:
			minmax = min(a, b)
			second = [min(a, b), max(a, b)]
		if min(a, b) == minmax:
			if min(a, b) > second[0]:
				second = [min(a, b), max(a, b)]
	elif (first[0] <= min(a, b) and first[1] <= max(a, b)) and (second[0] <= min(a, b) and second[1] <= max(a, b)):
		arrx.append('YES')
	else:
		arrx.append('NO')
print(*arrx)


import heapq
from sys import stdin, stdout
n = int(stdin.readline())
size = []
for i in range(n):
	(a, f, s) = stdin.readline().split()
	curVlaue = [int(f), int(s)]
	curVlaue.sort()
	if a == '+':
		if len(size) > 0:
			compare1 = heapq.heappop(size)
			compare2 = heapq.heappop(size)
			heapq.heappush(size, max(curVlaue[0], compare1))
			heapq.heappush(size, max(curVlaue[1], compare2))
		else:
			heapq.heappush(size, curVlaue[0])
			heapq.heappush(size, curVlaue[1])
	elif curVlaue[0] >= size[0] and curVlaue[1] >= size[1] or (curVlaue[1] >= size[0] and curVlaue[0] >= size[1]):
		stdout.write('YES\n')
	else:
		stdout.write('NO\n')


import sys
import io
n = int(input())
w = 0
h = 0
cmds = sys.stdin.read().splitlines()
old_stdout = sys.stdout
buf = io.StringIO()
sys.stdout = buf
for cmd in cmds:
	cmd = cmd.split()
	new_w = int(cmd[1])
	new_h = int(cmd[2])
	if new_w < new_h:
		(new_w, new_h) = (new_h, new_w)
	if cmd[0] == '+':
		w = max(w, new_w)
		h = max(h, new_h)
	else:
		print('YES' if new_w >= w and new_h >= h else 'NO')
sys.stdout = old_stdout
print(buf.getvalue(), end='')


from sys import *
(top, bot) = (-1, -1)
for c in range(int(input())):
	q = stdin.readline().split()
	(m1, m2) = (int(q[1]), int(q[2]))
	if m1 > m2:
		(m1, m2) = (m2, m1)
	if q[0] == '+':
		if top < m1:
			top = m1
		if bot < m2:
			bot = m2
	elif m1 < top or m2 < bot:
		print('NO')
	else:
		print('YES')


from sys import stdin
input = stdin.readline
x = 0
y = 0
for _ in range(int(input())):
	(s, a, b) = input().split()
	a = int(a)
	b = int(b)
	if s == '+':
		x = max(x, min(a, b))
		y = max(y, max(a, b))
	elif x <= min(a, b) and y <= max(a, b):
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
n = int(input())
y = z = -float('inf')
for i in range(n):
	(x, yy, zz) = map(str, input().split())
	if x == '+':
		a = [int(yy), int(zz)]
		a.sort()
		yy = a[0]
		zz = a[1]
		y = max(y, int(yy))
		z = max(z, int(zz))
	elif y <= int(yy) and z <= int(zz) or (y <= int(zz) and z <= int(yy)):
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
n = int(input())
blx = 0
bly = 0
for _ in range(n):
	(ipt, a, b) = input().split()
	if ipt == '+':
		(x, y) = (int(a), int(b))
		if x > y:
			(x, y) = (y, x)
		blx = max(blx, x)
		bly = max(bly, y)
	else:
		(h, w) = (int(a), int(b))
		if h > w:
			(h, w) = (w, h)
		if h >= blx and w >= bly:
			print('YES')
		else:
			print('NO')


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
x = y = -1
for _ in range(int(input())):
	(a, b, c) = input().strip().split()
	(b, c) = (int(b), int(c))
	if a == '+':
		if x == -1:
			(x, y) = (b, c)
		elif not (b <= x and c <= y or (c <= x and b <= y)):
			(p, q, r, s) = (max(x, b), max(y, c), max(c, x), max(b, y))
			if p * q < r * s:
				(x, y) = (p, q)
			else:
				(x, y) = (r, s)
	else:
		(h, w) = (int(b), int(c))
		f = 1
		if x <= h and y <= w or (y <= h and x <= w):
			f = 0
		print('YNEOS'[f::2])


import sys
input = sys.stdin.readline
Q = int(input())
nx = 0
ny = 0
for i in range(Q):
	(q, x, y) = input().split()
	(x, y) = (int(x), int(y))
	if x > y:
		(x, y) = (y, x)
	if q == '+':
		nx = max(nx, x)
		ny = max(ny, y)
	elif x >= nx and y >= ny:
		print('YES')
	else:
		print('NO')


import sys
n = int(input())
x = 0
y = 0
for i in range(n):
	task = sys.stdin.readline().split()
	(task[1], task[2]) = list(map(int, task[1:]))
	if task[0] == '+':
		x = max(x, max(task[1:]))
		y = max(y, min(task[1:]))
	elif max(task[1:]) >= x and min(task[1:]) >= y:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
t = int(stdin.readline())
cmin = 0
cmax = 0
no = 'NO\n'
yes = 'YES\n'
for i in range(t):
	(q, x, y) = stdin.readline().split()
	x = int(x)
	y = int(y)
	if q == '+':
		k = min(x, y)
		if k > cmin:
			cmin = k
		k = max(x, y)
		if k > cmax:
			cmax = k
	else:
		l = min(x, y)
		if l < cmin:
			stdout.write(no)
			continue
		else:
			l = max(x, y)
			if l < cmax:
				stdout.write(no)
				continue
			else:
				stdout.write(yes)


from sys import stdin, stdout
input = stdin.readline
n = int(input())
(a, b) = (0, 0)
(mn, mx) = (0, 0)
for i in range(n):
	s = input().strip().split()
	if s[0] == '+':
		(x, y) = map(int, s[1:])
		(a, b) = (max(a, b), min(a, b))
		a = max(a, min(x, y))
		b = max(b, max(x, y))
		mx = max(mx, max(x, y))
		mn = max(mn, min(x, y))
	else:
		(h, w) = map(int, s[1:])
		(h, w) = (max(h, w), min(h, w))
		(a, b) = (max(a, b), min(a, b))
		print('YES' if h >= a and w >= b or (h >= mx and w >= mn) else 'NO')


n = int(input())
(size1, size2) = (0, 0)
from sys import stdin
for i in range(n):
	q = stdin.readline().split()
	(t, a, b) = (str(q[0]), int(q[1]), int(q[2]))
	(mx, mn) = (max(a, b), min(a, b))
	if t == '+':
		if mx > size1:
			size1 = mx
		if mn > size2:
			size2 = mn
	elif size1 > mx or size2 > mn:
		print('NO')
	else:
		print('YES')


from itertools import combinations
from sys import stdin
import math

def listIn():
	return list(map(int, stdin.readline().strip().split()))

def stringIn():
	return [x for x in stdin.readline().split()]

def intIn():
	return int(stdin.readline())
n = intIn()
count = 0
for i in range(n):
	q = stringIn()
	if q[0] == '+':
		(x, y) = (int(q[1]), int(q[2]))
		count += 1
		if count == 1:
			m1 = max(x, y)
			m2 = min(x, y)
		else:
			m1 = max(m1, max(x, y))
			m2 = max(m2, min(x, y))
	else:
		(h, w) = (int(q[1]), int(q[2]))
		if m2 <= min(h, w) and m1 <= max(h, w):
			print('YES')
		else:
			print('NO')


import sys
input = sys.stdin.readline
n = int(input())
x = 0
y = 0
for k in range(n):
	(a, m, n) = input().split()
	m = int(m)
	n = int(n)
	p = max(m, n)
	q = min(m, n)
	if a == '+':
		x = max(x, p)
		y = max(y, q)
	elif a == '?':
		if x <= p and y <= q:
			print('YES')
		else:
			print('NO')


import sys
n = int(sys.stdin.readline().strip())
m = 0
M = 0
for i in range(0, n):
	line = sys.stdin.readline().strip().split()
	s = line[0]
	x = min([int(line[1]), int(line[2])])
	y = max([int(line[1]), int(line[2])])
	if s == '+':
		m = max([m, x])
		M = max([M, y])
	elif x >= m and y >= M:
		print('YES')
	else:
		print('NO')


(left_max, right_max) = (0, 0)
res = []
for _ in range(int(input())):
	(op, left, right) = input().split()
	(left, right) = (int(left), int(right))
	if left < right:
		(left, right) = (right, left)
	if op == '+':
		(left_max, right_max) = (max(left_max, left), max(right_max, right))
	elif left_max <= left and right_max <= right:
		res.append('YES')
	else:
		res.append('NO')
for answer in res:
	print(answer)


(x, y) = (0, 0)
from sys import stdin
for _ in range(int(input())):
	(a, i, j) = (o for o in stdin.readline().split())
	(i, j) = (int(i), int(j))
	if a == '+':
		x = max(x, min(i, j))
		y = max(y, max(i, j))
	elif x <= i and y <= j or (x <= j and y <= i):
		print('YES')
	else:
		print('NO')