While Mike was walking in the subway, all the stuff in his back-bag dropped on the ground. There were several fax messages among them. He concatenated these strings in some order and now he has string *s*.

He is not sure if this is his own back-bag or someone else's. He remembered that there were exactly *k* messages in his own bag, each was a palindrome string and all those strings had the same length.

He asked you to help him and tell him if he has worn his own back-bag. Check if the given string *s* is a concatenation of *k* palindromes of the same length.
The first line of input contains string *s* containing lowercase English letters (1 ≤ |*s*| ≤ 1000).

The second line contains integer *k* (1 ≤ *k* ≤ 1000).
m=str(input())
z=int(input())

def pol(s):
    for i in range(int(len(s)/2)):
        if not(s[i]==s[len(s)-1-i]):
            return False
            break;
    return True

#pol(m)
l=len(m)

l1=int(l/z)
#print (l1)
start=0
end=l1
for j in range(z):
    u=m[start:end]
    start+=l1
    end+=l1
    if (not(pol(u))):
        print("NO")
        exit(0)
print("YES")
