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*.

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.
The first line of input contains string *s* containing lowercase English letters (1 ≤ |*s*| ≤ 1000).

The second line contains integer *k* (1 ≤ *k* ≤ 1000).
#include<bits/stdc++.h>
using namespace std;
#define fast {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
typedef long long int ll;
typedef string st;
#define sl(x) scanf("%lld",&x);
#define si(x) scanf("%d",&x);
#define in(x)  cin>>x
#define o(x)  cout<<x
#define sp cout<<' '
#define nw cout<<endl
#define fr(i,a,n) for(int i=a;i<=n;i++)
#define frm(i,a,n) for(int i=n;i>=a;i--)
#define vc vector<ll>
bool sortin(const pair<ll,ll> &e,const pair<ll,ll> &f){return (e.first<f.first);}
ll i,j,k,l,m,n,c,p,q;
ll a[250002],b[100002],x[100002];
int main()
{
    fast;
    st s,t,r;
    in(s);in(n);
    l=s.size();
    k=l/n;
    if(l%n){o("NO");return 0;}
    fr(i,1,n)
    {
      t=s.substr(c,k);
      r=t;
      reverse(t.begin(),t.end());
      c+=k;
    if(r!=t){o("NO");return 0; }
    }
o("YES");
}

