#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long INF = 1e7;
double EPS = 1e-12;
const long long lim = 2e5 + 10;
template <typename T1>
void printIt(T1 t1) {
  cout << t1 << " )" << endl;
}
template <typename T1, typename... T2>
void printIt(T1 t1, T2... t2) {
  cout << t1 << " , ";
  printIt(t2...);
}
long long powP(long long x, long long y) {
  long long ans = 1, po = x % mod;
  while (y > 0) {
    if (y & 1) ans = ans * po % mod;
    y >>= 1;
    po = po * po % mod;
  }
  return ans;
}
vector<long long> V1, V2;
long long Array[lim], C[lim];
pair<long long, long long> P[lim];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  set<long long> S;
  long long int T, i, p, j, l, e, r, b, c, k, q, a, d, w, x, y, u, v, z, t,
      curr, prev, sum = 0, val, countA = 0, indicator = 0, pos, h, minA, maxA,
                  type, n, m, ans = 0, left, right;
  string A, B;
  T = 1;
  for (long long int tt = (1); tt <= (T); ++tt) {
    cin >> A >> k;
    indicator = 0;
    if (A.size() % k != 0) {
      cout << "NO" << endl;
      return 0;
    }
    k = A.size() / k;
    for (long long int i = (0); i <= (A.size() - 1); ++i) {
      val = (i / k) * k + k;
      if (A[i] != A[val - 1 - (i % k)]) {
        indicator = 1;
      }
    }
    if (indicator == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}

### Prompt

Construct a Cpp code solution to the problem outlined:

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.

<image>

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.

Input

The first line of input contains string s containing lowercase English letters (1 ≤ |s| ≤ 1000).

The second line contains integer k (1 ≤ k ≤ 1000).

Output

Print "YES"(without quotes) if he has worn his own back-bag or "NO"(without quotes) otherwise.

Examples

Input

saba
2


Output

NO


Input

saddastavvat
2


Output

YES

Note

Palindrome is a string reading the same forward and backward.

In the second sample, the faxes in his back-bag can be "saddas" and "tavvat".

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long INF = 1e7;
double EPS = 1e-12;
const long long lim = 2e5 + 10;
template <typename T1>
void printIt(T1 t1) {
  cout << t1 << " )" << endl;
}
template <typename T1, typename... T2>
void printIt(T1 t1, T2... t2) {
  cout << t1 << " , ";
  printIt(t2...);
}
long long powP(long long x, long long y) {
  long long ans = 1, po = x % mod;
  while (y > 0) {
    if (y & 1) ans = ans * po % mod;
    y >>= 1;
    po = po * po % mod;
  }
  return ans;
}
vector<long long> V1, V2;
long long Array[lim], C[lim];
pair<long long, long long> P[lim];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  set<long long> S;
  long long int T, i, p, j, l, e, r, b, c, k, q, a, d, w, x, y, u, v, z, t,
      curr, prev, sum = 0, val, countA = 0, indicator = 0, pos, h, minA, maxA,
                  type, n, m, ans = 0, left, right;
  string A, B;
  T = 1;
  for (long long int tt = (1); tt <= (T); ++tt) {
    cin >> A >> k;
    indicator = 0;
    if (A.size() % k != 0) {
      cout << "NO" << endl;
      return 0;
    }
    k = A.size() / k;
    for (long long int i = (0); i <= (A.size() - 1); ++i) {
      val = (i / k) * k + k;
      if (A[i] != A[val - 1 - (i % k)]) {
        indicator = 1;
      }
    }
    if (indicator == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}

```