#Lutece0505. 右递进整除数

右递进整除数

Migrated from Lutece 505 右递进整除数

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

001122\cdots991010个数字组成无重复数字的1010位整数AA。若AA的右边kk个数字所成的kk位数能被kk整除(1k101\leq k\leq 10),我们把这样的数AA称为右递进整除数。你的任务是读入整数AA,判断它是否是右递进整除数。

Input

有多组测试数据。输入的第一行是整数TT(1T2001\leq T\leq 200),表示随后测试数据的组数。每组测试数据占一行,由一个001122\cdots991010个数字组成无重复数字的1010位整数AA组成。

Output

对应每组测试数据,输出占一行。若AA为右递进整除数,输出Yes,否则输出No

Samples

2
9567123480
1740982563
Yes
No

Resources

wxiaoping