#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int k;
  cin >> k;
  int l = s.size();
  if (l % k == 0) {
    int g = l / k;
    int cnt = 0;
    for (int i = 0; i < s.size(); i++) {
      string t = "";
      int f = i + g;
      for (int j = i; j < f; j++) {
        t += s[j];
        i = j;
      }
      string r = t;
      reverse(t.begin(), t.end());
      if (r == t) {
        cnt++;
      }
    }
    if (cnt == k) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
