Anagrams divisible by 11

No attempts yetTime limit1sMemory limit128 MB

Problem

A natural number can be written as a sequence of digits, and a sequence of digits can be read back as a natural number. A leading zero is not allowed. For example, N=2090N = 2090 gives the sequence {2,0,9,0}\{2, 0, 9, 0\}, while the sequence {0,0,1,0}\{0, 0, 1, 0\} represents no natural number.

An anagram of a sequence keeps the same elements and only changes their order. Anagrams of a natural number are defined the same way. The anagrams of N=2090N = 2090 are 2009, 2090, 2900, 9002, 9020, 9200.

Given a natural number NN, write a program that counts how many anagrams of NN are multiples of 11. For N=2090N = 2090, only 2090 and 9020 are multiples of 11, so the answer is 2.

Input

The first line contains a natural number NN with no leading zero. (1N101001 \le N \le 10^{100})

Output

Print how many anagrams of NN are multiples of 11. The answer can be very large, so print it modulo 109+710^9 + 7.