human
Filled with optimism, Hyunuk will host a conference about how great this new year will be!

The conference will have n lectures. Hyunuk has two candidate venues a and b. For each of the n lectures, the speaker specified two time intervals [sa_i, ea_i] (sa_i ≤ ea_i) and [sb_i, eb_i] (sb_i ≤ eb_i). If the conference is situated in venue a, the lecture will be held from sa_i to ea_i, and if the conference is situated in venue b, the lecture will be held from sb_i to eb_i. Hyunuk will choose one of these venues and all lectures will be held at that venue.

Two lectures are said to overlap if they share any point in time in common. Formally, a lecture held in interval [x, y] overlaps with a lecture held in interval [u, v] if and only if max(x, u) ≤ min(y, v).

We say that a participant can attend a subset s of the lectures if the lectures in s do not pairwise overlap (i.e. no two lectures overlap). Note that the possibility of attending may depend on whether Hyunuk selected venue a or venue b to hold the conference.

A subset of lectures s is said to be venue-sensitive if, for one of the venues, the participant can attend s, but for the other venue, the participant cannot attend s.

A venue-sensitive set is problematic for a participant who is interested in attending the lectures in s because the participant cannot be sure whether the lecture times will overlap. Hyunuk will be happy if and only if there are no venue-sensitive sets. Determine whether Hyunuk will be happy.

Input

The first line contains an integer n (1 ≤ n ≤ 100 000), the number of lectures held in the conference.

Each of the next n lines contains four integers sa_i, ea_i, sb_i, eb_i (1 ≤ sa_i, ea_i, sb_i, eb_i ≤ 10^9, sa_i ≤ ea_i, sb_i ≤ eb_i).

Output

Print "YES" if Hyunuk will be happy. Print "NO" otherwise.

You can print each letter in any case (upper or lower).

Examples

Input

2
1 2 3 6
3 4 7 8

Output

YES

Input

3
1 3 2 4
4 5 6 7
3 4 5 5

Output

NO

Input

6
1 5 2 9
2 4 5 8
3 6 7 11
7 10 12 16
8 11 13 17
9 12 14...
 Write me a Python code to determine whether Hyunuk will be happy?
assistant
#Here is Python code to determine whether Hyunuk will be happy.

from operator import itemgetter
import sys
import bisect
input = sys.stdin.readline

class BIT():
    """区間加算、区間取得クエリをそれぞれO(logN)で答える
    add: 区間[l, r)にvalを加える
    get_sum: 区間[l, r)の和を求める
    l, rは0-indexed
    """
    def __init__(self, n):
        self.n = n
        self.bit0 = [0] * (n + 1)
        self.bit1 = [0] * (n + 1)

    def _add(self, bit, i, val):
        i = i + 1
        while i <= self.n:
            bit[i] += val
            i += i & -i

    def _get(self, bit, i):
        s = 0
        while i > 0:
            s += bit[i]
            i -= i & -i
        return s

    def add(self, l, r, val):
        """区間[l, r)にvalを加える"""
        self._add(self.bit0, l, -val * l)
        self._add(self.bit0, r,  val * r)
        self._add(self.bit1, l,  val)
        self._add(self.bit1, r, -val)

    def get_sum(self, l, r):
        """区間[l, r)の和を求める"""
        return self._get(self.bit0, r) + r * self._get(self.bit1, r) \
               - self._get(self.bit0, l) - l * self._get(self.bit1, l)

#座標圧縮したリストを返す
def compress(array):
    n = len(array)
    m = len(array[0])
    set_ = set()
    for i in array:
        for j in i:
            set_.add(j)
    array2 = sorted(set_)
    memo = {value : index for index, value in enumerate(array2)}
    
    for i in range(n):
        for j in range(m):
            array[i][j] = memo[array[i][j]]
    return array, len(memo)

n = int(input())
info = [list(map(int, input().split())) for i in range(n)]
info, m = compress(info)

"""
for i in range(n):
    a1, a2, b1, b2 = info[i]
    for j in range(i+1, n):
        c1, c2, d1, d2 = info[j]
        if (max(a1, c1) <= min(a2, c2)) ^ (max(b1, d1) <= min(b2, d2)):
            print(2)
"""

info = sorted(info, key = itemgetter(0))

bi = [None] * n
for i in range(n):
    bi[i] = (i, info[i][1])
bi = sorted(bi, key = itemgetter(1))
bii = [v for i, v in bi]

bit = BIT(m)
tmp = 0
for i in range(n):
    l, r, l2, r2 = info[i]    
    ind = bisect.bisect_left(bii, l)
    while tmp < ind:
        ii = bi[tmp][0]
       ...