Mahmoud has *n* line segments, the *i*-th of them has length *a*<sub class="lower-index">*i*</sub>. Ehab challenged him to use exactly 3 line segments to form a non-degenerate triangle. Mahmoud doesn't accept challenges unless he is sure he can win, so he asked you to tell him if he should accept the challenge. Given the lengths of the line segments, check if he can choose exactly 3 of them to form a non-degenerate triangle.

Mahmoud should use exactly 3 line segments, he can't concatenate two line segments or change any length. A non-degenerate triangle is a triangle with positive area.
The first line contains single integer *n* (3 ≤ *n* ≤ 10<sup class="upper-index">5</sup>) — the number of line segments Mahmoud has.

The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) — the lengths of line segments Mahmoud has.
For the first example, he can use line segments with lengths 2, 4 and 5 to form a non-degenerate triangle.
5
1 5 3 2 4
YES
3
4 1 2
NO
30
197 75 517 39724 7906061 1153471 3 15166 168284 3019844 272293 316 16 24548 42 118 5792 5 9373 1866366 4886214 24 2206 712886 104005 1363 836 64273 440585 3576
NO
30
229017064 335281886 247217656 670601882 743442492 615491486 544941439 911270108 474843964 803323771 177115397 62179276 390270885 754889875 881720571 902691435 154083299 328505383 761264351 182674686 94104683 357622370 573909964 320060691 33548810 247029007 812823597 946798893 813659359 710111761
YES
40
740553458 532562042 138583675 75471987 487348843 476240280 972115023 103690894 546736371 915774563 35356828 819948191 138721993 24257926 761587264 767176616 608310208 78275645 386063134 227581756 672567198 177797611 87579917 941781518 274774331 843623616 981221615 630282032 118843963 749160513 354134861 132333165 405839062 522698334 29698277 541005920 856214146 167344951 398332403 68622974
YES
40
155 1470176 7384 765965701 1075 4 561554 6227772 93 16304522 1744 662 3 292572860 19335 908613 42685804 347058 20 132560 3848974 69067081 58 2819 111752888 408 81925 30 11951 4564 251 26381275 473392832 50628 180819969 2378797 10076746 9 214492 31291
NO
3
1 1000000000 1000000000
YES
4
1 1000000000 1000000000 1000000000
YES
3
1 1000000000 1
NO
5
1 2 3 5 2
YES
41
19 161 4090221 118757367 2 45361275 1562319 596751 140871 97 1844 310910829 10708344 6618115 698 1 87059 33 2527892 12703 73396090 17326460 3 368811 20550 813975131 10 53804 28034805 7847 2992 33254 1139 227930 965568 261 4846 503064297 192153458 57 431
NO
42
4317083 530966905 202811311 104 389267 35 1203 18287479 125344279 21690 859122498 65 859122508 56790 1951 148683 457 1 22 2668100 8283 2 77467028 13405 11302280 47877251 328155592 35095 29589769 240574 4 10 1019123 6985189 629846 5118 169 1648973 91891 741 282 3159
YES
43
729551585 11379 5931704 330557 1653 15529406 729551578 278663905 1 729551584 2683 40656510 29802 147 1400284 2 126260 865419 51 17 172223763 86 1 534861 450887671 32 234 25127103 9597697 48226 7034 389 204294 2265706 65783617 4343 3665990 626 78034 106440137 5 18421 1023
YES
44
719528276 2 235 444692918 24781885 169857576 18164 47558 15316043 9465834 64879816 2234575 1631 853530 8 1001 621 719528259 84 6933 31 1 3615623 719528266 40097928 274835337 1381044 11225 2642 5850203 6 527506 18 104977753 76959 29393 49 4283 141 201482 380 1 124523 326015
YES
45
28237 82 62327732 506757 691225170 5 970 4118 264024506 313192 367 14713577 73933 691225154 6660 599 691225145 3473403 51 427200630 1326718 2146678 100848386 1569 27 163176119 193562 10784 45687 819951 38520653 225 119620 1 3 691225169 691225164 17445 23807072 1 9093493 5620082 2542 139 14
YES
44
165580141 21 34 55 1 89 144 17711 2 377 610 987 2584 13 5 4181 6765 10946 1597 8 28657 3 233 75025 121393 196418 317811 9227465 832040 1346269 2178309 3524578 5702887 1 14930352 102334155 24157817 39088169 63245986 701408733 267914296 433494437 514229 46368
NO
3
1 1000000000 999999999
NO
5
1 1 1 1 1
YES
10
1 10 100 1000 10000 100000 1000000 10000000 100000000 1000000000
NO
5
2 3 4 10 20
YES
6
18 23 40 80 160 161
YES
4
5 6 7 888
YES
9
1 1 2 2 4 5 10 10 20
YES
7
3 150 900 4 500 1500 5
YES
3
2 2 3
YES
7
1 2 100 200 250 1000000 2000000
YES
8
2 3 5 5 5 6 6 13
YES
3
2 3 4
YES
6
1 1 1 4 5 100
YES
13
1 2 3 5 8 13 22 34 55 89 144 233 377
YES
4
2 3 4 8
YES
3
5 6 7
YES
5
1 4 5 6 1000000
YES
4
5 6 7 20
YES
6
1 1 1 1 1 65
YES
4
3 4 5 100
YES
3
2 4 5
YES
7
1 1 1 1 1 10 1000
YES
4
1 1 2 3
NO
11
1 2 5 6 7 8 9 17 18 19 100
YES
4
5 16 20 200
YES
5
17 6 3 3 1
YES
3
1 1 1
YES
6
1 1 1 2 3 5
YES
4
2 4 6 6
YES
9
1 2 4 4 4 4 7 8 20
YES
9
1 1 2 5 5 5 10 10 20
YES
7
3 150 600 4 1700 6000 5
YES
5
5761 20966 27841 28800 29399
YES
9
1 2 3 6 7 10 11 12 24
YES
4
1 2 1 1
YES
5
1 1 2 3 4
YES
import sys
n, a = int(input()), list(map(int, input().split()))
a.sort()
for x in range(n - 2):
    if a[x] + a[x + 1] > a[x + 2]:
        print("YES")
        sys.exit()
print("NO")