{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eDo you think that counting is easy? This is not the case when you don\u0027t fully understand objects that you are counting.\u003c/p\u003e\n\n\u003cp\u003eLet\u0027s call a \u003cstrong\u003e2N\u003c/strong\u003e-digit integer \u003cstrong\u003eX\u003c/strong\u003e (possibly with leading zeroes) amusing if two \u003cstrong\u003eN\u003c/strong\u003e-digit integers \u003cstrong\u003ea\u003c/strong\u003e and \u003cstrong\u003eb\u003c/strong\u003e (again, possibly with leading zeroes) exist such that \u003cstrong\u003ea\u003c/strong\u003e + \u003cstrong\u003eb\u003c/strong\u003e \u003d \u003cstrong\u003e10^N\u003c/strong\u003e and \u003cstrong\u003eS_d\u003c/strong\u003e(\u003cstrong\u003eX\u003c/strong\u003e) \u003d \u003cstrong\u003eS_d\u003c/strong\u003e(\u003cstrong\u003ea\u003c/strong\u003e) + \u003cstrong\u003eS_d\u003c/strong\u003e(\u003cstrong\u003eb\u003c/strong\u003e) holds for every digit \u003cstrong\u003ed\u003c/strong\u003e, where \u003cstrong\u003eS_d\u003c/strong\u003e(\u003cstrong\u003eP\u003c/strong\u003e) (\u003cstrong\u003e0 \u003c/strong\u003e≤ \u003cstrong\u003ed \u003c/strong\u003e≤ \u003cstrong\u003e9\u003c/strong\u003e) is the number of occurrences of digit \u003cstrong\u003ed\u003c/strong\u003e in the decimal representation of \u003cstrong\u003eP\u003c/strong\u003e. For example, numbers \u003cstrong\u003e46\u003c/strong\u003e (\u003cstrong\u003e4\u003c/strong\u003e + \u003cstrong\u003e6\u003c/strong\u003e \u003d \u003cstrong\u003e10^1\u003c/strong\u003e), \u003cstrong\u003e9820\u003c/strong\u003e (\u003cstrong\u003e98\u003c/strong\u003e + \u003cstrong\u003e02\u003c/strong\u003e \u003d \u003cstrong\u003e10^2\u003c/strong\u003e) and \u003cstrong\u003e08362090\u003c/strong\u003e (\u003cstrong\u003e6020\u003c/strong\u003e + \u003cstrong\u003e3980\u003c/strong\u003e \u003d \u003cstrong\u003e10^4\u003c/strong\u003e) are amusing.\u003c/p\u003e\n\n\u003cp\u003eYou are given a sequence of digits and question marks of an even length. Find the number of ways to replace question marks with digits to get an amusing number, modulo \u003cstrong\u003e10^9\u003c/strong\u003e + \u003cstrong\u003e7\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eInput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eThe only line contains a non-empty sequence of digits and question marks. The length of the sequence is even and doesn\u0027t exceed \u003cstrong\u003e10^5\u003c/strong\u003e. The number of question marks doesn\u0027t exceed \u003cstrong\u003e1000\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eOutput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003ePrint the sought number of ways modulo \u003cstrong\u003e10^9\u003c/strong\u003e + \u003cstrong\u003e7\u003c/strong\u003e.\u003c/p\u003e\n\n"}},{"title":"Example","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\u003e2?4?\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}