Room Numbers

No attempts yetTime limit1sMemory limit128 MB

Problem

A secret agent named Pituś is hiding in a hotel in Byteland. Worried that someone might have learned his room number, during the night he secretly turned some of the digit 99s into 66s and some of the 66s into 99s on his room number.

Agent Dejf came to catch Pituś. Dejf found out the room number that Pituś was originally assigned (the number before any flipping) and also learned that 66s and 99s had been flipped. However, he does not know which digit positions were actually flipped. So he is wondering how many rooms he must check to be certain of finding Pituś.

In the original room number nn, every position holding a 66 or a 99 could now be either a 66 or a 99, and each such position is decided independently. Among all the distinct room numbers that can be formed this way, the ones that are actual rooms of the hotel (a number between 11 and hh inclusive) are exactly the rooms Dejf must check.

Given the number of rooms hh and the original room number nn, compute how many rooms Dejf must check. Print that count modulo 107310^7 - 3.

Input

The first line contains an integer hh (1h1010000001 \le h \le 10^{1000000}), the number of rooms in the hotel.

The second line contains an integer nn (1nh1 \le n \le h), the room number originally assigned to Pituś.

Both hh and nn are given as decimal integers without leading zeros and may have a very large number of digits.

Output

Print, on a single line, the number of rooms Dejf must check, taken modulo 107310^7 - 3.