题目描述
Problem Statement
You are given two strings S and T consisting of lowercase English letters.
Determine if there exists a pair of integers c and w such that $1 \leq c \leq w < |S|$ and the following condition is satisfied. Here, |S| denotes the length of the string S. Note that w must be less than |S|.
- If S is split at every w characters from the beginning, the concatenation of the c-th characters of the substrings of length at least c in order equals T.
Input
The input is given from Standard Input in the following format:
S T
Output
Print Yes if there exists a pair of integers c and w such that $1 \leq c \leq w < |S|$ and the condition is satisfied, and No otherwise.
Constraints
- S and T are strings consisting of lowercase English letters.
- $1 \leq |T| \leq |S| \leq 100$
Sample Input 1
atcoder toe
Sample Output 1
Yes
If S is split at every two characters, it looks like this:
at
co
de
r
Then, the concatenation of the 2nd characters of the substrings of length at least 2 is toe, which equals T. Thus, print Yes.
Sample Input 2
beginner r
Sample Output 2
No
w=|S| is not allowed, and no pair of integers $1 \leq c \leq w < |S|$ satisfies the condition. Thus, print No.
Sample Input 3
verticalreading agh
Sample Output 3
No
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分