Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclusion that he has no ready creations, and decided to write a program for rectangles detection. According to his plan, the program detects if the four given segments form a rectangle of a positive area and with sides parallel to coordinate axes. As Alex does badly at school and can't write this program by himself, he asks you to help him.
The input data contain four lines. Each of these lines contains four integers *x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub> ( - 10<sup class="upper-index">9</sup> ≤ *x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub> ≤ 10<sup class="upper-index">9</sup>) — coordinates of segment's beginning and end positions. The given segments can degenerate into points.
1 1 6 1
1 0 6 0
6 0 6 1
1 1 1 0
YES
0 0 0 3
2 0 0 0
2 2 2 0
0 2 2 2
NO
0 0 0 2
2 0 0 0
2 2 2 0
0 2 2 2
YES
0 0 10 0
0 0 10 0
0 0 0 5
0 0 0 -5
NO
0 0 4 0
4 0 3 0
3 0 2 0
2 0 0 0
NO
0 0 3 0
0 0 0 3
0 3 3 3
3 3 3 0
YES
0 0 1 0
1 0 1 1
0 1 1 1
0 0 0 1
YES
0 0 1 0
1 0 1 1
1 1 1 0
1 0 0 0
NO
0 0 1 1
1 1 2 0
2 0 1 -1
1 -1 0 0
NO
0 0 0 10
0 10 0 9
0 9 0 8
0 8 0 0
NO
0 0 4 0
4 0 4 0
4 0 0 0
0 0 0 0
NO
0 0 0 2
0 2 2 2
0 0 2 2
2 2 2 0
NO
0 0 0 2
2 0 2 2
0 2 0 0
2 2 2 0
NO
13 13 13 13
13 13 13 13
13 13 13 13
13 13 13 13
NO
0 0 2 0
0 1 0 3
0 4 3 4
3 0 3 3
NO
1 1 1 1
0 1 -1 1
-1 1 1 1
-1 1 1 1
NO
1 -1 1 -1
1 -1 1 -1
1 -1 1 -1
1 -1 1 -1
NO
-1 0 -1 0
-1 0 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 3
2 3 2 3
-3 3 -3 3
-3 3 2 3
NO
2 -2 2 -2
2 -2 2 -2
2 -2 2 -2
2 -2 2 -2
NO
2 -1 0 -2
-3 -2 -3 3
2 -2 2 -2
0 3 -3 -2
NO
1 -3 -1 1
0 -2 1 -3
1 1 0 1
1 -3 0 1
NO
-2 4 -2 4
-2 4 -2 -2
-2 4 -2 -2
-2 4 -2 -2
NO
3 1 3 1
-3 1 3 1
3 3 -3 1
-3 1 3 1
NO
0 1 4 1
0 1 4 1
4 1 0 1
0 -2 4 1
NO
0 -2 0 -1
0 -1 0 -2
0 -2 0 -2
0 -2 0 -2
NO
-1 1 -1 1
-1 1 -1 1
-1 1 -1 3
-3 1 -3 1
NO
578327678 518066351 578327678 498442467
583129774 498442467 578327678 518066351
583129774 518066351 578327678 518066351
583129774 498442467 578327678 518066351
NO
-973576966 32484917 -973576966 32484917
-973576966 32484917 347173379 32484917
-973576966 32484917 347173379 32484917
-973576966 32484917 347173379 32484917
NO
572793036 194804279 572793036 -866298887
572793036 461349977 -860420833 194804279
572793036 461349977 572793036 -866298887
-860420833 461349977 572793036 -866298887
NO
949753871 -467933239 -72251156 462207752
949753871 462207752 425479768 -467933239
425479768 462207752 425479768 -467933239
949753871 -467933239 949753871 462207752
NO
1 -1 1 -1
-1 -1 -1 -1
1 0 -1 -1
1 -1 -1 -1
NO
1 -1 1 -1
1 0 1 0
1 0 1 -1
1 0 1 -1
NO
0 0 0 1
0 1 0 1
0 1 0 0
0 1 0 1
NO
1 -1 1 0
1 0 1 0
0 0 0 -1
1 -1 1 0
NO
0 0 2 2
0 0 2 0
2 2 2 2
0 2 0 2
NO
-2 -1 -1 -1
-2 -1 -1 -1
-2 -1 -2 2
-2 2 -1 2
NO
2 1 -1 0
-1 0 2 1
2 1 2 1
-1 0 2 1
NO
1 -1 2 -1
1 -2 2 -2
1 -2 2 -2
1 -2 2 -2
NO
-1 -2 -1 2
-1 -2 -1 -2
-1 2 -1 2
-1 -2 -1 -2
NO
2 0 2 -1
2 -1 -1 0
2 -1 -1 0
2 -1 -1 0
NO
2 -3 1 3
1 -3 1 3
2 3 2 -3
2 -3 2 -3
NO
130120899 550158649 130120899 831843953
130120899 550158649 130120899 831843953
130120899 550158649 434006978 831843953
434006978 550158649 434006978 550158649
NO
-214484034 559719641 -214484034 559719641
-214484034 559719641 -214484034 559719641
-214484034 2764087 -214484034 559719641
-214484034 2764087 734280017 2764087
NO
-966947426 664261857 -994206270 664261857
-966947426 664261857 -994206270 664261857
-966947426 789165019 -966947426 789165019
-966947426 664261857 -966947426 789165019
NO
264411509 -329579381 264411509 -329579381
-726758913 -329579381 264411509 357369289
-726758913 -329579381 264411509 -329579381
264411509 -329579381 264411509 -329579381
NO
-193720583 -547078093 -570748852 58725936
-570748852 -547078093 -570748852 58725936
-193720583 58725936 -570748852 -547078093
-570748852 -547078093 -193720583 58725936
NO
-534094150 -333730697 120658438 -333730697
-534094150 -333730697 120658438 869464313
-534094150 -333730697 -534094150 -333730697
-534094150 869464313 -534094150 -333730697
NO
-328545071 835751660 -345950135 835751660
-345950135 243569491 -328545071 835751660
-328545071 835751660 -345950135 243569491
-328545071 243569491 -328545071 243569491
NO
-985236057 -809433993 -985236057 -225363622
-484344733 -225363622 -484344733 -225363622
-985236057 -225363622 -985236057 -809433993
-484344733 -225363622 -484344733 -809433993
NO
774287068 919049158 774287068 919049158
250033372 653817677 250033372 653817677
250033372 919049158 774287068 653817677
250033372 653817677 250033372 653817677
NO
15319063 -661389770 632904085 -661389770
15319063 834266473 632904085 834266473
15319063 834266473 15319063 -661389770
632904085 -661389770 632904085 834266473
YES
157550209 -594704878 157550209 524666828
671878188 -594704878 157550209 -594704878
671878188 -594704878 671878188 524666828
671878188 524666828 157550209 524666828
YES
-887135208 728202342 127569272 728202342
127569272 728202342 127569272 -932260532
-887135208 -932260532 -887135208 728202342
127569272 -932260532 -887135208 -932260532
YES
-777411660 -392696120 -777411660 878250237
461320023 878250237 -777411660 878250237
461320023 878250237 461320023 -392696120
461320023 -392696120 -777411660 -392696120
YES
-892785315 567101756 -892785315 212349618
-403060667 212349618 -403060667 567101756
-403060667 567101756 -892785315 567101756
-892785315 212349618 -403060667 212349618
YES
-360046034 -871603961 -37695563 -871603961
-37695563 664955871 -37695563 -871603961
-360046034 664955871 -360046034 -871603961
-360046034 664955871 -37695563 664955871
YES
375089524 -852468724 -952575952 -852468724
-952575952 -852468724 -952575952 -883150295
-952575952 -883150295 375089524 -883150295
375089524 -852468724 375089524 -883150295
YES
851113265 -893293930 851113265 -444742025
-864765585 -893293930 -864765585 -444742025
-864765585 -893293930 851113265 -893293930
-864765585 -444742025 851113265 -444742025
YES
-309306779 559081237 255096743 559081237
-309306779 -359724178 255096743 -359724178
255096743 -359724178 255096743 559081237
-309306779 559081237 -309306779 -359724178
YES
542957347 -480242202 566995046 -480242202
542957347 -480242202 542957347 -298569507
566995046 -298569507 542957347 -298569507
566995046 -298569507 566995046 -480242202
YES
724715871 -943657730 964573294 -943657730
724715871 -943657730 724715871 -216459206
964573294 -216459206 964573294 -943657730
724715871 -216459206 964573294 -216459206
YES
-394306310 -279360055 -394306310 771835446
-394306310 -279360055 -358661829 -279360055
-358661829 771835446 -358661829 -279360055
-358661829 771835446 -394306310 771835446
YES
-204472047 -894485730 -204472047 640004355
960702643 -894485730 960702643 640004355
960702643 -894485730 -204472047 -894485730
-204472047 640004355 960702643 640004355
YES
747591 5158024 -837871358 5158024
-837871358 -874026904 747591 -874026904
747591 -874026904 747591 5158024
-837871358 -874026904 -837871358 5158024
YES
-442585231 90863587 800882871 90863587
800882871 288218107 800882871 90863587
800882871 288218107 -442585231 288218107
-442585231 90863587 -442585231 288218107
YES
-969490772 476931470 -969490772 929999730
-426216863 929999730 -969490772 929999730
-426216863 929999730 -426216863 476931470
-969490772 476931470 -426216863 476931470
YES
-683046010 -125472203 -683046010 418507423
817863270 418507423 817863270 -125472203
817863270 418507423 -683046010 418507423
817863270 -125472203 -683046010 -125472203
YES
231996287 974811621 -923122611 974811621
-923122611 646880519 -923122611 974811621
231996287 646880519 231996287 974811621
-923122611 646880519 231996287 646880519
YES
-83429272 -350159212 -990378619 -350159212
-990378619 -350159212 -990378619 247777831
-83429272 -350159212 -83429272 247777831
-990378619 247777831 -83429272 247777831
YES
-679599706 974881765 -679599706 -84192294
-554774137 -84192294 -554774137 974881765
-554774137 974881765 -679599706 974881765
-554774137 -84192294 -679599706 -84192294
YES
-155221108 -190475340 -155221108 -819044368
-155221108 -190475340 -155875856 -190475340
-155875856 -190475340 -155875856 -819044368
-155875856 -819044368 -155221108 -819044368
YES
377126871 -877660066 -633390329 -877660066
377126871 -175686511 377126871 -877660066
-633390329 -877660066 -633390329 -175686511
-633390329 -175686511 377126871 -175686511
YES
919022298 897009314 77151365 897009314
77151365 579795002 919022298 579795002
77151365 579795002 77151365 897009314
919022298 579795002 919022298 897009314
YES
146411776 -188986353 146411776 -808042296
-381166510 -808042296 -381166510 -188986353
146411776 -188986353 -381166510 -188986353
146411776 -808042296 -381166510 -808042296
YES
438703475 871560515 571565350 871560515
571565350 -204157747 438703475 -204157747
438703475 -204157747 438703475 871560515
571565350 -204157747 571565350 871560515
YES
0 0 0 0
5 5 5 5
5 0 5 5
0 5 0 0
NO
0 1 1 2
2 1 1 2
1 0 0 1
2 1 1 0
NO
-3 0 -3 3
0 0 0 3
3 3 -3 3
3 0 -3 0
NO
0 0 0 0
1 1 1 1
0 1 0 1
1 0 1 0
NO
0 0 0 0
0 0 0 1
0 0 1 0
1 1 1 1
NO
0 0 1 0
1 1 0 1
0 0 1 0
1 1 0 1
NO
0 0 0 1
0 1 1 1
1 1 1 0
1 0 0 1
NO
0 0 1 1
0 1 1 0
1 1 0 0
1 0 0 1
NO
0 0 0 0
1 1 1 1
0 1 1 0
1 0 0 1
NO
0 0 1 0
0 1 1 1
0 0 1 0
0 1 1 1
NO
l = []

xs = []
ys = []
for i in range(4):
    x1, y1, x2, y2 = map(int, input().split())
    
    seg1,seg2 = (x1, y1),(x2, y2)
    l.extend([seg1, seg2])
    xs.extend([x1,x2])
    ys.extend([y1,y2])

xmax = max(xs)
xmin = min(xs)
ymax = max(ys)
ymin = min(ys)

pares = [(xmin,ymin),(xmin,ymax),(xmax,ymin),(xmax,ymin)]

cnt = 0
for j in range(1, len(l), 2):
    if l[j] == l[1]:
        cnt += 1
    
if cnt == 4:
    print("NO")
    
elif xmax == xmin or ymax == ymin:
    print("NO")

elif (xmin,ymin) not in l:
    print("NO")
else:
    
    print("YES")
    
    

  	    								 			  		 	   	 	