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: interview

Starter code:

Solutions:
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])
    else:
        if x >= m and y >= M:
            print("YES")
        else:
            print("NO")




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)
    else:
        if x>=nx and y>=ny:
            print("YES")
        else:
            print("NO")
    


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))
    else:
        if max(a, b) >= x and min(a, b) >= y:
            uu.append("YES")
        else:
            uu.append("NO")
print("\n".join(uu))

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

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
	else:
		if((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])

#	!/usr/bin/env python3
#	coding: UTF-8
#	Modified: <11/Jan/2019 09:31:41 PM>


#	✪ H4WK3yE乡
#	Mohd. Farhan Tahir
#	Indian Institute Of Information Technology (IIIT),Gwalior

#	Question Link
#
#

# ///==========Libraries, Constants and Functions=============///


import sys

inf = float("inf")
mod = 1000000007


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


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


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

# ///==========MAIN=============///


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


def __starting_point():
    main()

__starting_point()


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])]
        else:
            if bill_size[X] <= query[i][H] and bill_size[Y] <= query[i][W]:
                print("YES")
            else:
                print("NO")

def __starting_point():
    main()

__starting_point()

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))
    else:
        if (x<=i and y<=j) or (x<=j and y<=i):
            print("YES")
        else:
            print('NO')

''' Thruth can only be found at one place - THE CODE '''

''' Copyright 2018, SATYAM KUMAR'''
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) # max depth of recursion
threading.stack_size(2**27)  # new thread will get stack of such size

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, 1e9)
max_operation = Operation("max", max, max_multiple, -1e9)
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): #n**0.5 complex 
    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):
    """Returns True if n is prime."""
    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


# -------------------------------------------------------------- MAIN PROGRAM
TestCases = False
testingMode = False
optimiseForReccursion = False #Can not be used clubbed with TestCases
def is_Valid(a,b):
    #print(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")
        #print(mini,maxi)
# --------------------------------------------------------------------- END


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

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
    else:
        if ((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))

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))
    else:
        if (b>=x and c>=y) or (c>=x and b>=y):print('YES')
        else:print('NO')

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])
    else:
        if a[1]>=ma and a[2]>=mb:
            s+="YES\n"
        else:
            s+="NO\n"
print(s)


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
lax = -10**9;lay = -10**9
for _ in range(int(input())) :
  sign,x,y = list(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
     #print(lax,lay)
     if lax<=x and lay<=y :
         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))
        #print(mi,ma)
    elif t == '?':
        #print(mi,ma,a,b)
        if min(a,b) >= mi and max(a,b) >= ma:
            L.append("YES")
        else:
            L.append("NO")
print('\n'.join(L))

import sys
#sys.stdin = open('E:\\Sublime\\in.txt', 'r')
#sys.stdout = open('E:\\Sublime\\out.txt', 'w')
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))
    else:
        if max(a, b) >= x and min(a, b) >= y:
        	print('YES')
        else:
        	print('NO')

import sys
#sys.stdin = open('E:\\Sublime\\in.txt', 'r')
#sys.stdout = open('E:\\Sublime\\out.txt', 'w')
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))
    else:
        if max(a, b) >= x and min(a, b) >= y:
        	print('YES')
        else:
        	print('NO')