Problem D: 循环节的判定

Problem D: 循环节的判定

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

给定两个字符串 lns="http://www.w3.org/1998/Math/MathML">s 与 lns="http://www.w3.org/1998/Math/MathML">p,请判定 lns="http://www.w3.org/1998/Math/MathML">p 是否是 lns="http://www.w3.org/1998/Math/MathML">s 的循环节。所谓循环节就是将 lns="http://www.w3.org/1998/Math/MathML">p 复制若干遍拼接在一起后,恰好等于 lns="http://www.w3.org/1998/Math/MathML">s

Input

  • 第一行:单个字符串 lns="http://www.w3.org/1998/Math/MathML">s
  • 第二行:单个字符串 lns="http://www.w3.org/1998/Math/MathML">p

设 lns="http://www.w3.org/1998/Math/MathML">s 与 lns="http://www.w3.org/1998/Math/MathML">p 的长度分别为 lns="http://www.w3.org/1998/Math/MathML">n 与 lns="http://www.w3.org/1998/Math/MathML">m,则

  • 对于 lns="http://www.w3.org/1998/Math/MathML">50% 的数据,lns="http://www.w3.org/1998/Math/MathML">1n,m1000
  • 对于 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,lns="http://www.w3.org/1998/Math/MathML">1n,m1,000,000



Output

  • 如果 lns="http://www.w3.org/1998/Math/MathML">p 是 lns="http://www.w3.org/1998/Math/MathML">s 的循环节,输出 Yes,否则输出 No

Sample Input Copy

xyxy
xy

Sample Output Copy

Yes