#include <bits/stdc++.h>
using namespace std;
char Uplowch(char ch) {
  if (ch >= 'A' && ch <= 'Z') ch += 32;
  return ch;
}
char Lowupch(char ch) {
  if (ch >= 'a' && ch <= 'z') ch -= 32;
  return ch;
}
bool Isalpha(char ch) {
  if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) return true;
  return false;
}
int Strtoint(string str) {
  stringstream ss(str);
  int x = 0;
  ss >> x;
  return x;
}
string Intostr(int x) {
  stringstream ss;
  ss << x;
  string str = ss.str();
  return str;
}
void inline File_Read() {}
template <class T>
T abs(T a) {
  return (a < 0 ? -a : a);
}
bool matchs(string s, string p) {
  int i, len = (long long)p.size();
  for (i = 0; i < ((long long)s.size() - len) + 1; i++) {
    if (p == s.substr(i, len)) return true;
  }
  return false;
}
int cnt_matchs(string s, string p) {
  int i, cnt = 0, len = (long long)p.size();
  for (i = 0; i < ((long long)s.size() - len) + 1; i++) {
    if (p == s.substr(i, len)) cnt++;
  }
  return cnt;
}
long long arll[100010];
int ari[100010];
char arc[100005];
map<char, int> mci;
map<string, int> msi;
map<int, int> mii;
long long i, j, k, tc;
bool palindrom(string s) {
  string temp;
  temp = s;
  reverse((temp).begin(), (temp).end());
  return temp == s;
}
void solve1() {
  string s;
  int k;
  cin >> s;
  cin >> k;
  int len = (long long)s.size();
  if (len % k == 0) {
    int lp = len / k;
    for (int i = 0; i < k; i++) {
      int suru = 0 + (i * lp);
      int ses = suru + lp;
      string huda(lp, 0);
      int cc = 0;
      for (int j = suru; j < ses; j++) {
        huda[cc++] = s[j];
      }
      if (!palindrom(huda)) {
        cout << "NO" << '\n';
        return;
      }
    }
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
}
int main() {
  File_Read();
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  solve1();
  return 0;
}

### Prompt

Create a solution in cpp for 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;
char Uplowch(char ch) {
  if (ch >= 'A' && ch <= 'Z') ch += 32;
  return ch;
}
char Lowupch(char ch) {
  if (ch >= 'a' && ch <= 'z') ch -= 32;
  return ch;
}
bool Isalpha(char ch) {
  if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) return true;
  return false;
}
int Strtoint(string str) {
  stringstream ss(str);
  int x = 0;
  ss >> x;
  return x;
}
string Intostr(int x) {
  stringstream ss;
  ss << x;
  string str = ss.str();
  return str;
}
void inline File_Read() {}
template <class T>
T abs(T a) {
  return (a < 0 ? -a : a);
}
bool matchs(string s, string p) {
  int i, len = (long long)p.size();
  for (i = 0; i < ((long long)s.size() - len) + 1; i++) {
    if (p == s.substr(i, len)) return true;
  }
  return false;
}
int cnt_matchs(string s, string p) {
  int i, cnt = 0, len = (long long)p.size();
  for (i = 0; i < ((long long)s.size() - len) + 1; i++) {
    if (p == s.substr(i, len)) cnt++;
  }
  return cnt;
}
long long arll[100010];
int ari[100010];
char arc[100005];
map<char, int> mci;
map<string, int> msi;
map<int, int> mii;
long long i, j, k, tc;
bool palindrom(string s) {
  string temp;
  temp = s;
  reverse((temp).begin(), (temp).end());
  return temp == s;
}
void solve1() {
  string s;
  int k;
  cin >> s;
  cin >> k;
  int len = (long long)s.size();
  if (len % k == 0) {
    int lp = len / k;
    for (int i = 0; i < k; i++) {
      int suru = 0 + (i * lp);
      int ses = suru + lp;
      string huda(lp, 0);
      int cc = 0;
      for (int j = suru; j < ses; j++) {
        huda[cc++] = s[j];
      }
      if (!palindrom(huda)) {
        cout << "NO" << '\n';
        return;
      }
    }
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
}
int main() {
  File_Read();
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  solve1();
  return 0;
}

```