{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003eSnuke is having another barbeque party.\u003c/p\u003e\r\n\u003cp\u003eThis time, he will make one serving of \u003cem\u003eSkewer Meal\u003c/em\u003e.\u003c/p\u003e\r\n\u003cp\u003eHe has a stock of \u003cvar\u003e\\(N\\)\u003c/var\u003e \u003cem\u003eSkewer Meal Packs\u003c/em\u003e. The \u003cvar\u003e\\(i\\)\u003c/var\u003e-th Skewer Meal Pack contains one skewer, \u003cvar\u003e\\(A_i\\)\u003c/var\u003e pieces of beef and \u003cvar\u003e\\(B_i\\)\u003c/var\u003e pieces of green pepper.\r\nAll skewers in these packs are different and distinguishable, while all pieces of beef and all pieces of green pepper are, respectively, indistinguishable.\u003c/p\u003e\r\n\u003cp\u003eTo make a Skewer Meal, he chooses two of his Skewer Meal Packs, and takes out all of the contents from the chosen packs, that is, two skewers and some pieces of beef or green pepper.\r\n(Remaining Skewer Meal Packs will not be used.)\r\nThen, all those pieces of food are threaded onto both skewers, one by one, in any order.\u003c/p\u003e\r\n\u003cp\u003e(See the image in the Sample section for better understanding.)\u003c/p\u003e\r\n\u003cp\u003eIn how many different ways can he make a Skewer Meal? Two ways of making a Skewer Meal is different if and only if the sets of the used skewers are different, or the orders of the pieces of food are different.\r\nSince this number can be extremely large, find it modulo \u003cvar\u003e\\(10^9+7\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Constraints","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cul\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(2≦N≦200,000\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(1≦A_i≦2000, 1≦B_i≦2000\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Input","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003eThe input is given from Standard Input in the following format:\u003c/p\u003e\r\n\u003cpre\u003e\u003cvar\u003e\\(N\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(A_1\\)\u003c/var\u003e \u003cvar\u003e\\(B_1\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(A_2\\)\u003c/var\u003e \u003cvar\u003e\\(B_2\\)\u003c/var\u003e\r\n:\r\n\u003cvar\u003e\\(A_N\\)\u003c/var\u003e \u003cvar\u003e\\(B_N\\)\u003c/var\u003e\r\n\u003c/pre\u003e\r\n\r\n\u003c/section\u003e\r\n"}},{"title":"Output","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003ePrint the number of the different ways Snuke can make a serving of Skewer Meal, modulo \u003cvar\u003e\\(10^9+7\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n1 1\r\n1 1\r\n2 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e26\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eThe \u003cvar\u003e\\(26\\)\u003c/var\u003e ways of making a Skewer Meal are shown below.\r\nGray bars represent skewers, each with a number denoting the Skewer Meal Set that contained the skewer.\r\nBrown and green rectangles represent pieces of beef and green pepper, respectively.\u003c/p\u003e\r\n\u003cdiv style\u003d\"text-align: center;\"\u003e\r\n\u003cimg alt\u003d\"ebbq.png\" src\u003d\"CDN_BASE_URL/d17fbf4e45ebd792549328c62292b965?v\u003d1726398540\"\u003e\r\n\u003c/div\u003e\u003c/section\u003e\r\n"}}]}