Are they all palindromes?

You are given a string ss and a length ℓ\ell. Are all the substrings of length ℓ\ell of ss palindromes?

For instance, let s=s = “ababa” and ℓ=3\ell = 3. Here, we have s[0..2]=s[0..2] = “aba”, s[1..3]=s[1..3] = “bab” and s[2..4]=s[2..4] = “aba”. Since the three substrings of ss of length 3 are palindomes, in this case the answer is positive.

Input

Input consists of several cases, each with ss and ℓ\ell. Let nn be the size of ss. You can assume 1≤ℓ≤n≤1051 \le \ell \le n \le 10^5, and that ss is made up of only lowercase letters.

Output

For every case, print “yes” or “no”.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T10:12:41.353Z

© Jutge.org, 2006–2026.
https://jutge.org