#include <bits/stdc++.h>
char S[1010] = {0};
int main(void) {
  int k, Slen, ItemLen, flg = 1;
  scanf("%s", S);
  scanf("%d", &k);
  Slen = strlen(S);
  if (Slen % k) {
    flg = 0;
    goto PrintResult;
  }
  ItemLen = Slen / k;
  for (int i = 0; i < k; i++) {
    int a = i * ItemLen;
    int b = (i + 1) * ItemLen - 1;
    while (a < b) {
      if (S[a++] != S[b--]) {
        flg = 0;
        goto PrintResult;
      }
    }
  }
PrintResult:
  if (flg)
    printf("Yes");
  else
    printf("No");
  return 0;
}
