#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long int);
long long int LSTBT(long long int);
long long int ADVCEIL(long long int, long long int);
long long int GCD(long long int, long long int);
long long int MODMUL(long long int, long long int);
long long int MODEXPONEN(long long int, long long int);
void solve();
void OJ();
vector<long long int> arr;
set<long long int> pp;
set<long long int> mm;
pair<long long int, long long int> pi;
vector<pair<long long int, long long int> > vecpi;
vector<vector<long long int> > vecvec;
string str;
long long int i;
long long int negnum = -1;
signed main() {
  OJ();
  solve();
}
bool ispal(string s) {
  long long int n = s.length();
  long long int i = 0, j = n - 1;
  while (i <= j) {
    if (s[i] == s[j]) {
      i++;
      j--;
    } else {
      return false;
    }
  }
  return true;
}
void solve() {
  string s;
  long long int k;
  cin >> s >> k;
  long long int len = s.length() / k;
  long long int res = 0;
  long long int n = s.length();
  for (long long int i = 0; i < n; i++)
    if (n % k or s[i] != s[(i / len) * len + len - 1 - (i % len)]) {
      cout << "NO" << '\n';
      return;
    }
  cout << "YES" << '\n';
}
void OJ() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
bool isPrime(long long int n) {
  if (n == 1) return 0;
  for (long long int i = 2; i * i <= n; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
long long int LSTBT(long long int value) {
  long long int temp = value & (value - 1);
  return log2(value ^ temp);
}
long long int ADVCEIL(long long int number, long long int deno) {
  if (number % deno == 0) {
    return (number / deno);
  } else
    return (number / deno + 1);
}
long long int GCD(long long int a, long long int b) {
  if (a == 0) {
    return b;
  } else {
    return GCD(b % a, a);
  }
}
long long int MODMUL(long long int a, long long int b) {
  a %= 1000000000;
  b %= 1000000000;
  long long int res = 0;
  while (b > 0) {
    if (b & 1) res = (res + a) % 1000000000;
    a = (a * 2) % 1000000000;
    b /= 2;
  }
  return res;
}
long long int MODEXPONEN(long long int base, long long int power) {
  long long int res = 1;
  while (power > 0) {
    if (power & 1) res = MODMUL(res, base);
    base = MODMUL(base, base);
    power /= 2;
  }
  return res;
}

### Prompt

Your task is to create a Cpp solution to the following problem:

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;
bool isPrime(long long int);
long long int LSTBT(long long int);
long long int ADVCEIL(long long int, long long int);
long long int GCD(long long int, long long int);
long long int MODMUL(long long int, long long int);
long long int MODEXPONEN(long long int, long long int);
void solve();
void OJ();
vector<long long int> arr;
set<long long int> pp;
set<long long int> mm;
pair<long long int, long long int> pi;
vector<pair<long long int, long long int> > vecpi;
vector<vector<long long int> > vecvec;
string str;
long long int i;
long long int negnum = -1;
signed main() {
  OJ();
  solve();
}
bool ispal(string s) {
  long long int n = s.length();
  long long int i = 0, j = n - 1;
  while (i <= j) {
    if (s[i] == s[j]) {
      i++;
      j--;
    } else {
      return false;
    }
  }
  return true;
}
void solve() {
  string s;
  long long int k;
  cin >> s >> k;
  long long int len = s.length() / k;
  long long int res = 0;
  long long int n = s.length();
  for (long long int i = 0; i < n; i++)
    if (n % k or s[i] != s[(i / len) * len + len - 1 - (i % len)]) {
      cout << "NO" << '\n';
      return;
    }
  cout << "YES" << '\n';
}
void OJ() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
bool isPrime(long long int n) {
  if (n == 1) return 0;
  for (long long int i = 2; i * i <= n; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
long long int LSTBT(long long int value) {
  long long int temp = value & (value - 1);
  return log2(value ^ temp);
}
long long int ADVCEIL(long long int number, long long int deno) {
  if (number % deno == 0) {
    return (number / deno);
  } else
    return (number / deno + 1);
}
long long int GCD(long long int a, long long int b) {
  if (a == 0) {
    return b;
  } else {
    return GCD(b % a, a);
  }
}
long long int MODMUL(long long int a, long long int b) {
  a %= 1000000000;
  b %= 1000000000;
  long long int res = 0;
  while (b > 0) {
    if (b & 1) res = (res + a) % 1000000000;
    a = (a * 2) % 1000000000;
    b /= 2;
  }
  return res;
}
long long int MODEXPONEN(long long int base, long long int power) {
  long long int res = 1;
  while (power > 0) {
    if (power & 1) res = MODMUL(res, base);
    base = MODMUL(base, base);
    power /= 2;
  }
  return res;
}

```