Fujiwara-san loves dates! She calls a date a string of form y/m/d where d, m and y are positive integers without leading zeroes that represent a calendar date (d is the day, m is the month, y is the year). The precise rules for a valid date is the following:
For example, 2022/2/14, 2024/2/29 and 2000/2/29 are valid dates; whereas 2022/02/14, 2022/2/29 and 2100/2/29 are not valid dates.
Fujiwara-san has recently received a sequence of symbols s_1,…,s_n, where s_i∈0,1,…,9,/. She now wants to ask: how many sequences of indices 1≤i_1<⋯<i_k≤n exist such that s_i_1,…,s_i_k are a valid date?
The first line of the input contains the integer n. The second line contains the symbols s_1,…,s_n, not separated by spaces.
Output the answer modulo 109+7.