시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB57036431666.667%

문제

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.

입력

The first line contains a string $s$ consisting of lowercase alphabets. ($1 \le |s| \le 250,000$)

The second line contains an integer $k$. ($1 \le k \le 10^{18}$)

출력

If $t$ is a palindrome, print YES. If not, print NO.

예제 입력 1

abc
3

예제 출력 1

NO

예제 입력 2

abba
1

예제 출력 2

YES

출처

University > KAIST > 2018 KAIST 8th ACM-ICPC Mock Competition I번