405749: GYM102058 L Repetitive Palindrome
Memory Limit:1024 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
L. Repetitive Palindrometime limit per test1 secondmemory limit per test1024 megabytesinputstandard inputoutputstandard output
You are given a string $$$s$$$ consisting of lowercase alphabets, and an integer $$$k$$$.
Make a new string $$$t$$$ by concatenating $$$k$$$ copies of $$$s$$$. Determine whether $$$t$$$ is a palindrome, e.g. is the same backward as forward.
InputThe first line contains a string $$$s$$$ consisting of lowercase alphabets. ($$$1 \le |s| \le 250000$$$)
The second line contains an integer $$$k$$$. ($$$1 \le k \le 10^{18}$$$)
OutputIf $$$t$$$ is a palindrome, print YES. If not, print NO.
ExamplesInputabcOutput
3
NOInput
abbaOutput
1
YES