P17763 [HackerEarth] You have moved to Colorland. Currency System here consists of various type of coins.
普及-
题目描述

You have moved to Colorland. Currency System here consists of various type of coins.

Each coin in Colorland has exactly one color. The coin color follow these rules.
All coins of same denomination have same color.
No two coins of different type have same color.

You know all coin denominations used in Colorland, but you dont know their colors. You dont even know the set of colors used for them.

For each denomination you would like to know the color of coins of that denomination.
For that, you have a credit card and an ATM , both having infinite amount.

You can ask for some amount X from the ATM. The ATM will provide you with the required amount of money with those coins.
It uses the following pseudocode to uniquely determine the set of coins it will use to pay you X amount of money.
func(x, a, n) // a is array containing different denominations
sort(a, n)
for i = n to 1
t = x / a[i]
give t coins of i'th type
x -= t * a[i]
You will be given long A[] which shows the different coin denominations available. A[1] will always be 1 so ATM can always give desired amount of money.

Determine if there exists some X, for which the number of coins of each denomination given by ATM is different and non-zero so that you can identify what color
each denomination coins are of.

If there exists some X, print "YES" else print "NO".

Input Format:

First line contains T, the number of test cases.
For each test case, first line contains N, the number of different coin denominations.
Second line contains N distinct integers which are sorted in ascending order.

Output Format :

Print YES/NO for each test case in a single line.

Constrains :

1 ≤ T ≤ 10^6
1 ≤ N ≤ 10^6
1 ≤ sum of N over all cases ≤ 10^6
1 ≤ A[i] ≤ 10^18

SAMPLE INPUT
2
3
1 3 6
3
1 2 4

SAMPLE OUTPUT
YES
NO

Explanation

For test case 1, take X = 23.
ATM will give 3 coins of 6$, 1 coin of 3$ and 2 coins of 1$
In {3 , 1 , 2}, each number is non-zero and distinct. Hence, you can identify color of each denomination.

For test case 2, there doesn't exist any valid X.
For e.g. taking X = 7,
ATM will give 1 coin of 4$, 1 coin of 2$ and 1 coin of 1$
In {1 , 1 , 1} , all elements are not distinct. Hence it is not valid.

Similarly, For X = 10,
ATM will give 2 coins of 4$, 1 coin of 2$ and 0 coins of 1$
In {2 , 1 , 0}, all elements are not non-zero. Hence it is not valid.

输入格式

见题面

输出格式

见题面

样例输入
50 5 1 372865516247910061 544499811794170931 724709092985296072 751148172333681673 5 1 75509013615358962 236823649324300778 277105358266875316 333604956174205496 5 1 108124384201821495 380109926150430243 462648268306203434 648900974642904334 5 1 21511346892920857 355251548887466106 368294269984324626 997524514778118587 5 1 209901589929955413 271678380944748938 486551214517119690 940767619286567481 5 1 293610589334318279 528250115492547498 567430523994465670 904487759029834554 5 1 6802674174748324 234464436435798957 866698336473031245 885936340849064862 5 1 189349426964106626 203861728891980010 698699515750512788 862583263917242160 5 1 106403810147560553 344154553719871355 751121474975090838 966621953378825122 5 1 291237957804951379 551256933661045931 565326508295791019 692802186209659888 5 1 58393008003751891 285348901314305628 376800376202319679 411500482285872328 5 1 108581823455885173 418314517642403698 483646048908705971 571964831562902410 5 1 624893704213965289 688608012913083967 713922695462221424 865086654173723884 5 1 253002195488965503 372222614613113562 495262466704740147 862213306488347426 5 1 127620638359286209 583177309245567134 697068286518371591 955348095816742885 5 1 75029741362715562 86319397917394139 329989982456588835 799541882734103271 5 1 36555348912073004 460540559400525906 880387159769852972 902069693538175031 5 1 565989323651524038 711557673403766444 976751029298690776 988190153895907743 5 1 255845738198945118 315520814549368494 399318704477756063 471701734838846771 5 1 26235550466962204 76942772921890682 207677644566388269 807979875360991348 5 1 77398208787388562 251662529557469582 252998165360777076 562908736979138379 5 1 594191811515606870 649350144060353476 927712469948936517 941870622468659360 5 1 463173691417749670 476704140389812547 531731020412155152 729109441511598543 5 1 611501637883051230 628782233253024672 933824877354016590 976211515603058764 5 1 278737074849766144 328750688422770622 678650615420526874 716152051512299256 5 1 234303493882871113 311975602351023889 652914438038944820 658361592506421189 5 1 661055654142899262 797178760490805255 879062823902466893 959351895887551772 5 1 221218311970722094 227559512780070947 235569719956183219 347028919292385599 5 1 53927228493279429 151745735493968159 314174307770264495 440240963792716192 5 1 38431425943076915 125763027653458667 284601845757565046 371404086888924977 5 1 390038209388363424 925770370271398535 979582415041301005 981185370523891647 5 1 83918773510172035 217077966769659586 452864307650065794 531695561705729926 5 1 119953092352116868 476626210797943558 508857463543103804 773593620471951977 5 1 7516886326023515 326213801903279257 433127728863409803 634187899460017608 5 1 219720013585513667 353174149322101693 667422659602554434 714176472643075244 5 1 488973625841939012 591796647585981775 768317294815464243 853218143311108783 5 1 206256436688172087 270263400714638315 531639973805025187 900980497175649110 5 1 151754574852821260 334990053457087182 748689477776698959 959526070581619491 5 1 211522173555920510 573154522167975941 769725794892516613 851834014066427077 5 1 293082923204656612 612401737282815946 654769250494169361 881877669374081598 5 1 68659853974568007 340596039258621580 487787957954416734 719181984532732729 5 1 59342571424715731 391881309184638516 469356960653142001 787870044175445228 5 1 51301043323728221 419097510938998837 743253375999250107 816944235527325494 5 1 479451358838444258 490730212844815463 551346906025794073 845749601484443151 5 1 208227342536690171 554522498973995570 793535628534167904 939341180396689791 5 1 312482396116249120 658287588971760751 673584869685224505 717749551482992243 5 1 95167357570875621 241953320500344778 331412003665044949 991377739469975167 5 1 81374648201602169 220198619972346740 293532317328384886 749485465347689481 5 1 154099572667151439 198618756437469636 215527724027480167 671003586703843663 5 1 154357363264374035 369117782192722978 432018990649462943 980624902568526846
样例输出
NO NO NO YES NO NO YES NO YES NO NO NO NO NO NO YES NO NO NO YES YES NO NO NO NO NO NO NO NO YES NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO