P14963 [HackerEarth] Bear recently studied the depth first traversal of a Tree in his Data Structure class. He learnt the following algorithm for doing a dfs on a tree.
普及
题目描述

Bear recently studied the depth first traversal of a Tree in his Data Structure class. He learnt the following algorithm for doing a dfs on a tree.

void dfs(int v,int p){
vis[v] = 1;
for(int i=0;i<G[v].size();++i){
if(G[v][i]!=p)
dfs(G[v][i],v);
}
}

Now he was given an array A, Tree G as an adjacency list and Q queries to answer on the following modified algorithm as an homework.

void dfs(int v,int p){
vis[v] += 1;
for(int j=1;j ≤ A[v];++j){
for(int i=0;i<G[v].size();++i){
if(G[v][i]!=p)
dfs(G[v][i],v);
}
}
}

The Q queries can be of the following two types :
$1\space v\space x$ : Update A[v] = x. Note that updates are permanent.
$2\space v$ : Initialize $vis[u] = 0 \space \forall \space u$ ∈ [1,N]. Run the above algorithm with call dfs(1,-1). Compute the sum $\large\displaystyle \sum_{u$ ∈ $Subtree\space$ of$\space v}^v vis[u].$ As the result may be quite large print it $mod\space 10^9+7$

INPUT
The first line contains two integers N and Q, the number of vertices in the tree and the number of queries respectively.
Next N-1 lines contains the undirected edges of the tree.
The next lines contains N integers denoting the elements of array A.
Following Q lines describe the queries.

OUTPUT
For each query of type 2, print the required result $mod\space 10^9+7$.

CONSTRAINT
1 ≤ N, Q ≤ 10^5
1 ≤ $A[v],\space x$ ≤ 10^9
1 ≤ v ≤ N

SAMPLE INPUT
4 9
1 2
2 3
3 4
1 1 1 1
2 1
2 2
2 3
2 4
1 3 100
2 1
2 2
2 3
2 4

SAMPLE OUTPUT
4
3
2
1
103
102
101
100

输入格式

见题面

输出格式

见题面

样例输入
10 10 2 1 4 2 9 7 10 4 8 3 7 6 6 1 3 1 5 4 320 733 36 947 339 687 854 295 29 11 2 8 1 1 166 2 6 2 5 2 7 1 8 807 2 7 1 4 353 1 5 418 1 8 725
样例输出
346249194 971278569 129813765 901523762 861777600 539498991 227466150 185514201 462336141 359095773 979709517 73633783 86581201 93497279 137683662 352418382 115675716 622469808 771279308 229077431 765075486 400539939 374121599 303333588 835227467 472765100 876742466 308135678 689698236 670784478 280027370 476883104 92317584 695975368 533448117 353554146 630925747 284572305 543170439 738552853 991036727 19473689 916748118 122470116 683497474 487775370 777812127 799098462 14704708 167600641 738863521 389018646 517793022 331629209 24210306 335948422 61524602 724258472 821288974 557436101 446571872 760342246 903924821 487014693 490403460 202913672 145067485 883819619 971801885 251973459 179128458 796119317 3991080 188013278 251142630 321003330 652625150 79776506 493060389 109057643 994474238 835803529 622297021 698855656 607505814 72166323 81756757 142347090 18153478 49065516 414371017 132835524 255705089 429739617 433890700 375577337 867672785 469972392 904908334 179449820 138270040 346633405 375566452 529811564 659632393 506025297 225879166 991789218 511206871 331998452 726352428 411622597 114743759 293741067 619491162 218041355 645307663 309538468 65742096 504580995 183386075 895523818 999665539 611666412 797080429 691696603 648545703 262315145 283913845 951431157 147378856 434598140 103086648 847096661 494740698 447723168 804974994 939763167 141153353 606081198 887682524 631287023 135225544 929484309 623735630 617029450 894807147 314513013 269898067 257566580 648928720 13292557 657380912 126344153 835071262 310527618 839273457 671742412 436416965 799275552 921093235 796292619 719665410 253004091 606338720 885912126 428925878 228136433 399957934 790142645 901785473 130115212 532774472 388284586 895624458 991084116 952052888 509460632 818675884 517616243 991216302 832087606 119196569 475976611 933470340 251378161 61871664 723385112 596460571 780738561 121347582 586865682 938049394 932840011 473013996 234752004 575930369 670810779 203988468 400503716 519552739 857218844 357388832 269589855 748187921 198817162 885863339 420923883 752903256 676272836 575448174 85943541 818026703 677967488 979612703 131299825 320853666 167362682 421362795 831125198 590054173 74825314 757614857 978096212 737935742 836581511 153053183 253569794 388319058 590745908 474413429 653734908 336673538 323499363 927532304 722930270 559053836 526122848 361151833 751925052 56263548 547406356 97826745 56907519 820950019 180722721 208511256 539044940 642480916 881491259 761403489 285755398 83641307 657937601 864864746 824648727 851140103 80154284 238372589 549544116 845768343 365267927 360901668 818065300 688223629 205276560 991499391 981892937 258861610 744301906 541508883 367002386 646398379 90023948 420569059 85367014 644353310 323425380 840882463 213695447 635223511 756037226 832114037 515495872 247788755 606248401 784097207 105938064 751342121 397919906 648504418 229514542 275702861 794485820 461963245 131672443 69527792 118794069 322408739 736185602 847047801 179597458 483787800 818200421 693218380 905082313 644363433 464185547 85083984 421167020 769964068 232353950 778504004 297611068 480203647 202516505 102986403 25681770 987004804 613664374 318285811 501072096 906565628 549747272 796993559 362135703 990233016 902381679 108633800 369907193 889973603 867821893 282561305 198380273 885354539 23348623 558175803 886558923 280681337 973879479 859969206 530597714 604159361 446976596 130695085 685092148 647375726 351454862 737403445 663265600 734682395 549754235 770283059 932719507 798384296 394962930 381300370 863080956 345770728 211910751 727904075 177852014 765743390 101055466 800548495 507194246 747841856 379587258 752989099 543088305 244841355 288234013 440236763 254935790 893481182 347254072 386768822 8001390 254846002 746400810 929567474 434318393 290622377 936662211 886044866 771677436 656647700 934083283 185555971 531212815 865063754 113326710 299105080 180783894 817238986 725905004 196083328 94301511 261330458 851592172 390618826 166693962 754135937 149575748 812049704 269273284 867765856 623935154 126376363 315860670 545906341 535319437 748023461 545313070 518078338 11929976 506774686 27695667 520847238 750048031 708057361 214384795 893001052 559000779 435966375 905335793 828752730 215857906 676919511 508760218 315939550 794742575 826991048 867011532 824260452 31100098 974921269 375577291 892041530 535439930 76210973 959861184 373399058 269728582 243683729 556580755 521559358 496621947 655307638 978552012 185280126 326463376 521647364 211759086 118080118 671280022 61755086 902799447 842381842 834490072 984629477 679357882 589103968 970057914 126974365 722749165 415837519 762242802 396962411 504327294 999069167 157620951 850495582 228468988 928439941 849884979 345532814 620480390 410545098 417446603 191334516 622830580 285018222 9518227 721088155 287529981 765462052 840558837 975273143 439027544 610394106 347051411 197591403 907264726 947377978 339018192 258293764 708633514 802657036 364892625 226108048 401727035 396540088 952736259 759481960 815845315 117568928 125673476 560399760 894876169 960381246 654989948 760823923 585117975 126099626 579506506 663576919 933682680 660358621 392089522 559816125 207659296 804831763 115126839 443791038 164806898 485732868 72302469 993495640 948894727 378757557 849436159 1448447 371889136 571493728 124671094 201759060 585174559 922752340 73695704 96344632 880090030 588574056 798548888 792526816 28589455 61056694 673863025 387142078 680715131 967992645 19810885 548488782 107716056 640854670 665221007 836502715 351324793 651407966 898130728 304428215 568904148 743051307 344429541 277926456 418700704 350777326 909865485 307621373 629983327 140386081 106228235 950658063 225207060 978326570 61843031 417333428 134262509 881291305 254245236 455228814 592247305 647003451 598776699 612881747 670681484 520656714 191863558 361664670 392346153 572979060 810929244 935938034 377576408 508333160 872638454 518317394 702193116 560676115 76189684 874422206 551547519 276269443 999434914 30383896 183651230 320711401 181774721 201683230 383109303 674747085 283302443 827672927 948985995 395897559 121939204 140633499 30221499 203413753 648317618 195070731 95491956 393165824 345129255 128380802 818550160 250873077 864007001 865192702 566615606 861096759 872918035 429638742 841151611 170468921 653372762 676502559 595443966 697567201 255206624 422786776 670870276 51610537 517049596 953586960 39026517 825763775 9316088 388636716 145903681 979191333 798633275 945359282 82903332 769669875 720610650 679567159 221191081 439651185 407932428 588563624 357116239 112728695 204469991 794087516 182409982 635953126 224514830 880934464 797640217 466798632 349375831 833873408 198624961 426210892 50129332 783375975 370163681 816734486 939851292 456942994 871810200 18644931 119519342 593782539 215958875 554843869 51030427 749381585 511552165 574543120 556229078 47337080 526718595 878272539 120023773 180925497 985362904 759706449 524784316 52606621 759194559 90928130 148239574 418579659 671575170 840236728 505908448 8767222 30744040 498716860 210768303 829519594 936837057 466045794 627828414 243779806 443887554 205754184 83949161 318034284 620315909 582790576 306590381 265091495 906936796 609251659 602758740 672363446 541952601 686823336 890394172 699847807 356293183 906543434 227109531 824212192 62837862 827031157 227401872 700523987 829092114 320961153 894405352 873209874 835035742 472914993 67305431 969312984 931667297 441838594 902076560 602331214 455929473 141079891 350203401 970952803 841462364 772139194 475717042 95708116 556886000 939568205 533130149 740632922 278160098 917128691 411355892 90828048 881340914 253038696 319706372 413275132 345473347 730827287 614540514 82518062 109468617 878070518 161105691 550869755 491074200 311245778 923658238 43102435 315543548 632789154 290082093 113216692 581640862 274588761 58511604 591115369 773950742 262106833 720894664 362606322 90642875 838733098 192341300 959325287 760300450 878726129 604325790 990542863 806406804 235108249 310050223 38134960 944243935 778541863 677584700 633890929 212945970 957474563 436651919 337577163 386194413 429622331 91510237 10897562 513902585 71621859 410046629 441169806 771303860 11451360 996882186 752949976 145579132 60537239 1070918 264184606 674316484 393730509 990020661 592396148 534441272 605212181 574437816 625345578 334933212 55192637 342861364 578020546 20664127 164812769 521420851 46929878 225793233 728250976 650606365 936233236 680710100 732874247 36635577 876428968 346391539 185005853 159202167 235103835 609855846 61071482 464439666 375715423 449689925 197097163 168197304 773198041 899401373 335626741 383152121 545285379 300131773 42304630 349208417 150082683 950351326 562381185 182177014 660210810 829139119 153537045 855918510 771153185 341929640 469480461 37557053 59379410 587018718 30017695 549914650 897307345 928307235 560271527 116110365 233544651 389704226 511654277 267734884 459923289 791680877 493371366 105450212 684916274 53868297 908454586 281739762 469136125 485377563 10551502 659165295 983737991 651653015 408550618 648256679 498051854 200243370 135503740 399170579 666978541 811492915 879791860 777196397 751835377 61799954 813529420 257086140 971892279 41825126 419930556 398851388 303922588 480493444 865495324 881419050 98604463 763191468 552274348 335323192 737415185 616588313 461443469 875176580 10145528 726305675 78366184 119407875 628889805 244874739 149967086 587811749 748832171 488872235 353936657 150828258 852702122 679893471 770931757 880092963 5659926 816412834 406044076 742295321 382784605 429628272 910889786 155008092 943730084 349914198 930359433 476946706 569681591 348993679 90901806 800562887 421853994 822005154 100172456 251826651 334874107 894797939 863938864 168729351 552592220 384001362