P18582 [HackerEarth] You will be given a number n- number of distinguishable objects. Your task is to calculate the number of ways that n objects can be grouped into sets if no set can be empty.
普及
题目描述

You will be given a number n- number of distinguishable objects. Your task is to calculate the number of ways that n objects can be grouped into sets if no set can be empty.
For example, the letters AB can be grouped into following sets- {(AB)} and {(A), (B)}. Thus, for n=2 the answer is 2.

Another eg:- the letters can be ABC can be grouped into following sets-
{ (ABC) },
{ (AB) , (C) },
{ (AC) , (B) },
{ (BC) , (A) },
{ (A) , (B) , (C)}.

Thus the answer is 5.

Since the answer could be very large, output it modulo 1000000007.

Input :
The first line of the input contains an integer T (1 ≤ T ≤ 500), the number of test cases. Then T test cases follow. Each test case consists of a line which contains a positive integer, n (1 ≤ n ≤ 500).

Output :
Output the answer as per the constraints given in the problem statement.

SAMPLE INPUT
3
1
2
3

SAMPLE OUTPUT
1
2
5

输入格式

见题面

输出格式

见题面

样例输入
500 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
样例输出
1 2 5 15 52 203 877 4140 21147 115975 678570 4213597 27644437 190899322 382958538 480142077 864869230 76801385 742164233 157873304 812832668 706900318 546020311 173093227 759867260 200033042 40680577 159122123 665114805 272358185 365885605 744733441 692873095 463056339 828412002 817756178 366396447 683685664 681586780 840750853 683889724 216039853 954226396 858087702 540284076 514254014 647209774 900185117 348985796 609459762 781824096 756600466 654591160 171792186 748630189 848074470 75742990 352494923 278101098 462072300 334907097 10474572 495625635 586051441 159996073 479379757 707597945 561063550 974840072 209152841 906106015 467465396 82034048 392794164 700950185 344807921 475335490 496881113 358229039 519104519 784488542 665151655 307919717 591199688 692769253 335414677 884560880 847374378 791103220 200350027 485480275 557337842 434181960 73976309 792463021 462067202 677783523 295755371 435431099 193120002 513369106 134597056 143018012 353529690 591382993 163160926 287984994 842145354 703798750 386436223 618375990 636477101 536261496 574800957 34046224 167415054 961776342 807141069 218578541 513967253 460200768 230725907 239843627 792763805 368353031 740982762 126993201 967654419 588554507 728057622 239984996 818342358 882367644 216705655 267152940 867213913 330735015 934583772 59261085 443816525 568733052 754405433 244324432 153903806 292097031 557968620 311976469 242994387 773037141 549999484 243701468 941251494 7149216 932327662 456857477 739044033 645452229 69273749 304951367 503353209 243194926 688663125 239795364 522687881 121506491 835250259 159173149 545801717 19848500 322507013 106069527 807985703 290163328 971751677 238407093 981758956 301257197 728003485 817681690 318332431 864806329 87958605 929106232 617996713 519300437 307911059 137306007 887695462 633135243 442387331 730250437 27723819 80605394 760335262 822289356 415861662 558003999 645049413 347692428 380668983 897875109 278111491 106909073 951914124 374756177 635211535 286442394 774619548 756991257 929298287 923425488 182439740 266683608 415378498 728411148 808161291 436338820 692451577 228029692 235546564 895805974 758052804 700926159 226442121 579900323 96916377 243044550 858703179 30279679 343764928 100627558 840734795 291199760 989808717 370270411 158336199 393391701 881731480 507200370 588418523 340981140 295449954 683858381 903859151 866470542 4959332 237784075 861373023 950693473 955867890 400039807 939877954 124824910 954530940 204884446 42218442 234856311 189836713 179563650 683193288 929322036 73574908 943547254 103031032 141180580 540183111 680050153 382916846 948921599 252835397 199109508 551172546 700090782 44999714 970123610 145637563 33948107 267648423 504777414 584919509 212459491 242880452 351366578 345323768 285497541 692868556 706562675 675626979 620872182 136458675 971105139 182064384 948539342 186406165 706529481 790490927 888369436 784409511 835815713 447895018 17015606 342727699 321837918 394134115 563672582 70390332 61116103 949269501 833942074 581389345 570974405 768179852 765734098 928340756 541194960 126833304 427218334 75800034 100445725 242810216 330081440 986329793 298082322 643160582 505669854 255287400 403977567 659185446 596703087 289443930 478095124 920175726 205886838 729278433 535998256 658801091 606948240 432632296 552723022 17794080 234033713 189986528 444922724 263196004 846019724 684703320 895782046 505050988 44287113 505335732 436498414 12098144 714227851 643983136 647148160 579243434 951209063 511291462 426622734 830870687 949900312 599926584 633837711 176405710 913717356 753535741 874916804 956692925 220742732 649500982 584759931 109573948 937203173 96881033 305784835 559854872 894253854 746366726 951492991 532579856 822308583 572042503 397665465 600979983 914199453 628402767 594763006 9791558 451332658 516069180 651367831 962708649 687016963 539878802 107278296 926059014 371504543 556987417 447666745 565595310 778161513 995461128 121460302 599892490 242414970 900391574 362620950 292857964 495260535 355054738 176340034 370047225 509682533 459314034 40869728 534741938 788604648 945028000 701904601 154924404 695162652 220536827 615701976 167761915 833779942 52430883 368585637 936409860 654822736 613850019 941559844 357840989 218223326 721900618 171013438 597980462 193395922 949112044 859322955 354602094 807705992 347609311 451694117 623122523 252980054 491785682 13877214 918727309 750110421 114981703 174636266 363160184 781715298 30575457 862940854 642129450 34525888 798422280 792396821 168367459 344551406 799847612 626838494 671596530 167280197 959000039 614621296 273560655 8705247 284372524 940371542 906010703 582585495 929449942 308961449 768816240 674729787 279648144 286568146 938661138 536038536 456529723 18843013 501518651 457224675 520694423 938573228 179014658 169719825 459657583 302109678 560375405 556039265 348713003 957546568 687116649 3656313 562760316 716689588 324677598