#pragma warning(disable:4996)
#include <stdio.h>
#include <malloc.h>
#include <math.h>
#include <stdlib.h>
#define N 100
#define EPS 1E-5
int lol(const void *x1, const void *x2)
{
	return *(int*)x1 - *(int*)x2;
}

int main(void)
{
	int i, n, k,ch[26] = { 0 };
	int max1 = 0, max2 = 0;
	char c;
	scanf("%i%i", &n, &k);
	scanf("%c", &c);
	do
	{
		scanf("%c", &c);
		if (c != '\n')
			ch[c - 'a']++;
	} while (c != '\n');
	for (i = 0; i < 26; i++)
		if (ch[i] > max1)
			max1 = ch[i];
	if (max1 <= k)
		printf("YES");
	else
		printf("NO");
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char a[110], b[100];
int main()
{
    int n, k, i, j, t=0;
    scanf("%d %d", &n, &k);
    char a[n+5];
    scanf("%s", a);
    for(i=0;i<strlen(a);i++)
        b[a[i]-97]++;
    for(i=1;i<=k;i++)
    {
        for(j=0;j<30;j++)
        {
            if(b[j]!=0)
                b[j]--;
        }
    }
    for(i=0;i<30;i++)
    {
        if(b[i]==0)
            t++;
    }
    if(t==30)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include <stdio.h>
#include <string.h>

int main()
{
	int n,k,l,i,j,count=0,count_balons;
	char s[105];

    scanf("%d",&n);
    scanf("%d",&k);
	scanf("%s",s);

	l=strlen(s);

	for(i=0;i<l-1;i++)
	{
		count_balons=1;
		for(j=i+1;j<l;j++)
		{
			if(s[i]==s[j] && s[j]!=0)
			{
				count_balons++;
				s[j]=0;
			}

		}

		if(count_balons>k)
			{
				count=1;
				break;
			}

	}

	if(count==1)
		printf("NO\n");
	else
		printf("YES\n");

}

#include<stdio.h>
#include<stdlib.h>

int cf(void const *a, void const *b)
{
	return (*(int*)a) - (*(int*)b);
}
int main()
{
	int n, k, i, x=0, a[101], c=1, y=0;
	char s[101];

	scanf("%d %d %s", &n, &k, s);

	for(i=0; i<n; i++)
	{
		a[i]=s[i]-'0';
	}
	qsort(a, n, 4, cf);

	for(int h=0; h<n-1; h++)
	{
		if(a[h]==a[h+1])
		{
			c++;
			y=1;
		}
		else
		{
			if(c>=x){
				x=c;
			}
			c=1;
			y=0;
		}
	}
	if(y==1 && c>=x){
		x=c;
	}
	if(x<=k || n<=k){
		printf("YES");
	}
	else{
		printf("NO");
	}
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main(){
	int	baloes, amigos;
	char cores[101];
	int frequencia[30];

	scanf("%d %d", &baloes, &amigos);

	fgets(cores, 100, stdin);

	for (int i = 0; i < 30; ++i)
	{
		frequencia[i] = 0;
	}

	int c;

	for (int i = 0; i < baloes; ++i){

		c = (int)getchar();

		frequencia[c%97]++;

		if (frequencia[c%97] > amigos)
		{
			printf("NO\n");
			exit(0);
		}
	}

	printf("YES\n");

}

#include <stdio.h>
#include <string.h>
#include<stdlib.h>
int main()
{
    char s[101];
    int i,n,k,len,x=0;
    int f[27];
    scanf("%d %d",&n,&k);
    scanf("%s",s);
    len = strlen(s);
    for(i=0; i<27; i++)
    {
        f[i]= 0;
    }
    for(i=0; i<len; i++)
    {
            f[s[i] - 'a']++;
    }
    for(i=0;i<27; i++)
    {
        if(f[i]!= 0)
        {
            if(f[i]>k){
                x=1;
                break;
            }
        }
    }
    if(x==1)
        printf("NO\n");
    else if(x==0)
        printf("YES\n");
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int fre[256];
    int n,k,i,j,l,m,c,max;
    scanf("%d %d",&n,&k);
    c=0;
    max=0;
    char str[n+1];
    scanf("%s",str);
    l=strlen(str);
    for(m=0;m<256;m++){
            fre[m]=0;
    }
    for(j=0;j<l;j++){
        fre[str[j]]++;
    }
    for(i=0;i<256;i++){
        if(fre[i]!=0){
            if(fre[i]>fre[max]){
                max=i;
            }
        }
    }
    if(fre[max]<=k)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

char vector[26];

int main()
{
	int n; //baloons
	int k; //friends
	char c;
	scanf("%d %d", &n, &k);

	c = getchar();

	for(int i = 0; i < n; i++)
	{
		c = getchar();
		for(int j = 0; j < 26; j++)
			if(c == j + 97)
				vector[j]++;
	}

	for(int i = 0 ; i < 26; i++)
		if(vector[i] > k)
		{
			printf("No");
			return EXIT_SUCCESS;
		}

	printf("YES\n");

	return EXIT_SUCCESS;
}

#include<stdio.h>
#include<string.h>
int main()
{
int b,p,i=0,j=0,m=0,x;
char q;
char pattern[100];
int arr[26];
int y;
for(y=0;y<26;y++)
{
    arr[y]=0;
}
int k;

scanf("%d %d",&b,&p);
scanf("%s",pattern);
x=strlen(pattern);

while(pattern[i]!='\0')
{
    if(pattern[i]>='a' && pattern[i]<='z')
    {

        arr[pattern[i]-'a']++;

    }i++;

}

while(j<26){
{if(arr[j]<=p)
    m++;
 else
        m=-1000;

}
j++;};
if(m>0)
    printf("YES");
else
    printf("NO");
}

#include<stdio.h>
#include<string.h>
int main()
{
    int n,k,i,ascii[123];
    for(i=65;i<123;i++)ascii[i]=0;
    char bal[100];
    scanf("%d %d",&n,&k);
    scanf("%s",bal);
    for(i=0;i<n;i++)ascii[bal[i]]++;
    for(i=65;i<=122;i++)
    {
        if(ascii[i]>k)
        {
            printf("NO");
            return 0;
        }
    }
    printf("YES");
}

#include <stdio.h>

int alph[26];
char ballon[101];
int main(void)
{
	int n, k, cnt = 0, a;
	scanf("%d %d", &n, &k);
	scanf("%s", ballon);
	for (a = 0; a < n; a = a + 1)
	{
		alph[ballon[a] - 'a']++;
	}

	for (a = 0; a < 26; a = a + 1)
	{
		if (alph[a])
		{
			cnt++;
			if (alph[a] > k)
			{
				puts("NO");
				cnt = -1;
				break;
			}
		}
	}
	if (cnt != -1)
		puts("YES");
	return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(){
    int n,k;
    scanf("%d",&n);
    scanf("%d",&k);
    char* arr = (char*)malloc(sizeof(char)*n);
    // if(n<k){
    //     printf("NO");
    //     return 0;
    // }
    int i=0,x=0,y=0;
    for (i=0;i<n;i++){
        scanf(" %c",&arr[i]);
    }
    int freq[26] ={0};
    for (i =0;i<n;i++){
        arr[i] = tolower(arr[i]);
        freq[(int)arr[i] - (int)'a']++;
    }
    for (i =0;i<26;i++){
        if(freq[i] > k) {
            printf("NO");
            return 0;
        }
    }
    printf("YES");

}

#include<stdio.h>
#include<string.h>
#include<stdbool.h>
#include<math.h>
#include<stdlib.h>

int cmp(const void* a, const void* b)
{
	return (*(int*)a - *(int*)b);
}

int Max(int a, int b)
{
	return a > b ? a : b;
}

int main(void)
{
	int i, j;
	int a[30] = { 0 };
	int n, k;
	int num = 0;
	char x;

	scanf("%d %d", &n, &k);
	getchar();
	for (i = 0; i < n; i++)
	{
		x = getchar();
		a[x - 'a']++;
	}
	for (i = 0; i < 30; i++)
		num = Max(num, a[i]);
	if (num > k) printf("NO");
	else printf("YES");

	return 0;
}

#include <stdio.h>

int main() {
	int blln, frnd, cnt = 1;
	char tmp;
	scanf("%d  %d", &blln, &frnd);
	char *col = (char *)malloc(sizeof(char) * (blln+30));
	scanf("%s", col);

	for (int i = 0; i < blln -1 ; i++) {
		for (int j = i + 1; j < blln; j++) {
			if (col[i] > col[j]) {
				tmp = col[i];
				col[i] = col[j];
				col[j] = tmp;
			}
		}
	}

	for (int i = 0; i < blln; i++) {
		if (col[i] == col[i + 1]) {
			++cnt;
			if (cnt > frnd) {
				printf("NO");
				free(col);
				return 0;
			}
		}
		else {
			cnt = 1;
		}
	}
	printf("YES");

	free(col);
	return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
	int  n,k,i;
	int  mas[26];
	char s;
	for (i=0;i<=25;i++)
		mas[i]=0;
	scanf("%d %d",&n,&k);
	scanf("%c",&s);
	for (i=0;i<n;i++)
	{
		scanf("%c",&s);
		mas[s-'a']++;
	}
	for (i=0;i<=25;i++)
		if (mas[i]>k)
		{
			printf("NO");
			return 0;
		}
	printf("YES");
	return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
	int n,k,i,j=0;
	int ans = 1;
	scanf("%d%d",&n,&k);
	char s[n];
	int a[26] = {0};
	scanf("%s",s);
	for(i=0;i<n;i++)
	{
		a[s[i]-'a']++;
	}
	for(i=0;i<26;i++)
	{
		if(a[i]>k)
		ans=0;
	}
	if(ans == 0)
	printf("NO");
	else
	printf("YES");
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main()
{
	int i,n,k,l,m,b[26]={0};
	char s[105];
	scanf("%d%d", &n, &k);
	scanf("%s",s);
	for(i=0; s[i] !='\0'; i++)
		b[s[i]-'a']++;
	l=b[0];
	for (i=1; i<26; i++)
		if (b[i] > l) l = b[i];

	if (l > k)
		printf("NO\n");
	else
		printf("YES\n");
	return 0;
}

#include<stdio.h>
#include<string.h>

int main()
{
	int n,k,i,j=0;
	char a[105];
	int b[26]={0};

	scanf("%d %d",&n,&k);
	scanf("%s",a);

	if(n<k)
	{
		printf("YES");
	}
	else
	{
		for(i=0;i<n;i++)
		{
			b[a[i]-97]++;
		}
	for(i=0;i<26;i++)
	{
		if(b[i]>k)
		{
			j++;
			break;
		}
	}
	if(j==0)
		printf("YES");
	else
		printf("NO");
	}

	return 0;
}

#include <stdio.h>
int main(void)
{
    int i,j,k,l,m,n,count=0,count1=0;
    char a[150];
    scanf("%d %d",&n,&m);
    getchar();
    gets(a);
    for(i=97;i<124;i++){
        for(j=0;j<n;j++){
            if(a[j]==i){
                count++;
            }
        }
        if(count>m){
            count1++;
            break;
        }
        else{
            count=0;
        }
    }
    if(count1==0){
        printf("YES");
    }
    else {
        printf("NO");
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main() {
	int n,
		k;
	char c;
	int* count = (int*)calloc(26, sizeof(int));

	scanf(" %d %d", &n, &k);

	while (n-- > 0) {
		scanf(" %c", &c);

		count[c - 'a']++;

		if (count[c - 'a'] > k) {
			printf("NO");
			return 0;
		}
	}

	printf("YES");

	return 0;
}
/* 1506029843161 */

#include<stdio.h>
int main()
{
    int N,k,i,g[26]={0},max=0;
    char str[101];
    scanf("%d%d",&N,&k);
    for(i=0;i<=N;i++)
        scanf("%c",&str[i]);
        for(i=0;i<=N;i++)
        {
            g[str[i]-'a']++;
        }
            for(i=0;i<26;i++)
            {
                if(g[i]>max)
                    max=g[i];
            }
            if(max<=k)
                printf("yes\n");
            else
                printf("no\n");
            return 0;
}

#include <stdio.h>

int main() {
	int baloes, amigos, tabela[26] = {0}, i = 0;
	char cor[10000];

	scanf("%d %d", &baloes, &amigos);
	scanf("%s", cor);
	while(cor[i] != '\0') {
		tabela[cor[i] - 97]++;
		if(tabela[cor[i] - 97] > amigos) {
			printf("NO");
			return 0;
		}
		i++;
	}
	printf("YES");
	return 0;
}
/* 1506616595709 */

#include<stdio.h>
int main(){

 int i,j,s=0,n,k,ary[100],count=0;
 char str[100];

 scanf("%d %d",&n,&k);
 scanf("%s",str);

 for(i=0;i<n;i++){
    for(j=0;j<n;j++){
        if(str[i]==str[j]){
            s++;
        }
    }
    ary[i]=s;   //printf("array = %d\n",ary[i]);
    s=0;
 }

 for(i=0;i<n;i++){
    if(ary[i]>k){
        count++;
    }
 }

 if(count==0){
    printf("YES\n");
 }
 else
    printf("NO\n");

return 0;
}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
    int n,k;
    scanf("%d %d",&n,&k);
    char s[n];
    scanf("%s",s);
    int flag=0;
    char alph[27]={0};
    for(int i=0;i<strlen(s);i++)
    {
        alph[abs(s[i]-97)]++;
        if(alph[abs(s[i]-97)]>k)
            {
               /* printf("%d",alph[abs(s[i]-97)]);*/
                printf("NO");
                flag=1;
                break;

            }

    }
    if(flag!=1)
    {
        printf("YES");
    }

}

#include<stdio.h>
int main()
{
    int n,k,j,num,i;
    scanf("%d %d",&n,&k);
    char s[n+1];
    scanf("%s",&s);
    for(i=97;i<=122;i=i+1)
    {
        int count=0;
        j=0;
        while(s[j]!=0)
        {
           num=s[j];
           if(num==i)
           {
               count=count+1;
           }
           j=j+1;
        }
        if(count>k)
        {
            printf("NO\n");
            exit(0);
        }
    }
    printf("YES\n");
}

#include<stdio.h>
int main()
{
    int n,k,i,j,c=0,max=0;
    scanf("%d%d",&n,&k);
    char str[n];
    scanf("%s",str);
    for(i='a';i<='z';i++)
    {
        for(j=0;str[j];j++)
        {
            if(i==str[j])
            c++;
        }
        if(c>max)
        max=c;
        c=0;
    }
    if(max<=k)
    printf("YES");
    else
    printf("NO");
}

#include<stdio.h>
#include<string.h>
int arr[100];
int main()
{
    int n,k,i;
    char s[150];
    scanf("%d%d",&n,&k);
    getchar();
    gets(s);
    int d=1;
    for(i=0; i<n; i++)
    {
        int c=s[i]-'a';
        arr[c]++;
        if(arr[c]>k)
        {
            printf("NO\n");
            d=0;
            break;
        }
    }
    if(d==1)
        printf("YES\n");
    return 0;
}

/* Problem: 841A - Generous Kefa */
/* Author: Gusztav Szmolik */

#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main ()
    {
    unsigned short n;
    unsigned short k;
    unsigned char s[101];
    unsigned short i;
    unsigned short h[26];
    unsigned short ups;
    unsigned char c;
    unsigned short j;

    if (scanf("%hu %hu",&n,&k) != 2)
        return -1;
    if (n < 1 || n > 100 || k < 1 || k > 100)
        return -1;
    if (scanf("%100s",s) != 1)
        return -1;
    if (strlen(s) < n)
        return -1;
    for (i = 0; i < 26; i++)
        h[i] = 0;
    ups = 0;
    for (i = 0; i < n; i++)
        {
        c = s[i];
        if (!islower(c))
            return -1;
        if (!ups)
            {
            j = c-'a';
            h[j]++;
            if (h[j] > k)
                ups = 1;
            }
        }
    printf ((ups) ? "NO\n" : "YES\n");
    return 0;
    }

#include <stdio.h>

int main(){

	char car;
	int n,k,count[30];
	scanf("%d %d\n",&n,&k);

	for(int i = 0; i < 26; ++i)
		count[i] = 0;

	for(int i = 0; i < n; ++i){
		scanf("%c",&car);
		count[car-'a']++;
	}

	int exd = 0;
	for(int i = 0; i < 26; ++i)
		if(count[i] > k) exd = 1;

	if(exd) printf("NO\n");
	else printf("YES\n");

	return 0;
}

#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main(void){

  int n,k;

  int alphab[26];
  char baloons[100];

  for(int i=0;i<26;i++){
    alphab[i]=0;
  }

  scanf("%d %d", &n, &k);
  scanf("%s", baloons);

  for(int i=0;i<n;i++){
    alphab[baloons[i]-'a']+=1;
  }

  for(int i=0;i<26;i++){
    if(alphab[i]>k){
      printf("NO\n");
      return 0;
    }
  }

  printf("YES\n");
}

#include<stdio.h>
#include<string.h>
char s[201];
int a[26];
int main()
{
 int n,k;
 scanf("%d%d%s",&n,&k,s);
 for(int i=0;i<n;i++)
 {
  a[s[i]-'a']++;
 }
 for(int i=0;i<26;i++)
 {
   if(a[i]>k)
   return puts("NO");
 }
 puts("YES");
 return 0;
}

#include <stdio.h>

int N,K;
char baloon[110];
int chart[30];
int friend[110][30];

int sol(){
	int i,j,det=1,ball,ref=N;

	for(i=0;i<N;i++){
		det = 1;
		ball = -1;
		for(j=0;j<26;j++){
			if(chart[j]){
				chart[j]--;
				det--;
				ball = j;
				break;
			}
		}
		if(det) return 0;

		det =1;
		for(j=0;j<K;j++){
			if(friend[j][ball] == 0) {
				friend[j][ball]++;
				det--;
				break;
			}
		}
		if(det) return 0;

	}

	return 1;
}

int main(){

	int i,ans,j;
	scanf("%d %d",&N,&K);

	scanf("%s",baloon);

	for(i=0;i<N;i++){
		chart[baloon[i]-'a']++;
	}
	ans = sol();
	if(ans) printf("YES");
	else printf("NO");

	return 0;
/*
	for(i=0;i<26;i++){
		if(chart[i])
			printf("%c : %d\n",'a'+i,chart[i]);
	}printf("\n");

	sort();

	for(i=0;i<N;i++){
		printf("%c",baloon[i]);
	}printf("\n");
*/
}

#include <stdio.h>
#include <stdlib.h>
int main()
{ int k,n,somme,j;
    char tab[101],i;
    scanf("%d%d",&n,&k);
    scanf("%s",tab);
    for (i='a';i<='z';i++)
    {
somme=0;
    for (j=0;j<=strlen(tab)-1;j++)
    {
        if (tab[j]==i)
        {
            somme++;
        }
    }
    if (somme>k){i='z'+1;}
    }
    if (somme<= k){printf("YES");}else{printf("NO");}
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int n,k;
    scanf("%d %d",&n,&k);
    char arr[n+1];
    scanf("%s",arr);
    int i;
    int brr[27];
    for(i=0;i<27;i++)
    brr[i]=0;
    for(i=0;i<n;i++)
    {
       brr[arr[i]-96]++;
    }
    int flag=0;
    for(i=0;i<27;i++)
    {
        if(brr[i]>k)
        {
            printf("NO\n");
            flag=1;
            break;
        }
    }
    if(flag==0)
    printf("YES\n");
}

#include<stdio.h>
int main()
{
    int n,m,i,mx=0,c[27]= {0};
    char a[101];
    scanf("%d%d",&n,&m);
    scanf("%s",a);
    for(i=0; i<n; i++)
    {
        c[a[i]-97]++;
        if(c[a[i]-97]>mx)
            mx=c[a[i]-97];
    }
    if(mx>m)
        printf("NO\n");
    else
        printf("YES\n");
    return 0;
}

#include <stdio.h>

int main()
{
	int b_cnt = 'z' - 'a' + 1;
	int	b_mas[ b_cnt ];
	memset( b_mas, 0, sizeof( b_mas ));
	int n,k,i;
	char sym;
	scanf( "%d %d", &n, &k );
	int ans = 1;
	i=0;
	while ( i < n ) {
		scanf( "%c", &sym );
		if ( sym == ' ' || sym == '\n')
			continue;
		b_mas[sym - 'a']++;
		i++;
	}
	for ( i=0; i < b_cnt; i++ ) {
		if ( b_mas[i] > k ) {
			ans = 0;
			break;
		}
	}
	printf("%s\n", ans ? "YES" : "NO");
}

#include<stdio.h>
int main(){
char s[1000];
int arr[30] ;
int n ,k ,i ;
for(i = 0; i< 27 ; i++)
  arr[i] = 0;

scanf("%d %d",&n,&k);
getchar();

gets(s);
  for(i = 0; i< n ;i++){
    arr[s[i]-'a']++;
  }

int flag =0, j  , count;
j = k;
while(k--){
    count = 0;
  for(i = 0 ;i<27 ;i++){
    if(arr[i] >0 )
    {
      arr[i]--;
      count++;

    }
  }
}
  for(i = 0 ;i< 27 ;i++)
    if(arr[i] != 0){
      flag = 1;
    }
if(flag == 1) printf("NO\n");
else printf("YES\n");

return 0;}

#include <stdio.h>

int main(){
  int i;
  int n, k;
  scanf("%d %d", &n, &k);
  char str[1000];
  scanf("%s", str);
  char cou[30];
  for(i=0;i<30;i++)
    cou[i]=0;
  for(i=0;i<n;i++)
    cou[str[i]-97]++;
  int cnt=0;
  for(i=0;i<30;i++)
    if(cou[i]>k){
      printf("NO\n");
  return 0;}
  printf("YES\n");

  return 0;
}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int arr[26];
int main()
{
	int n,k;
	scanf("%d %d",&n,&k);
	int i,j,flag=0;
	char c;
	getchar();
	for(i=0;i<n;i++)
	{
		scanf("%c",&c);
		if(c>='a'&&c<='z')
		{
			arr[c-'a']++;
			if(arr[c-'a']>k)
			{
				flag=1;
				break;
			}
		}
		if(c>='A'&&c<='Z')
		{
			arr[c-'A']++;
			if(arr[c-'A']>k)
			{
				flag=1;
				break;
			}
		}
	}
	if(flag)
	{
		printf("NO\n");
	}
	else
	{
		printf("YES\n");
	}
	return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<math.h>
#define ll long long int

int main()
{
    int n,k,a[26],i,max=0;
    char s[1001];
    scanf("%d %d",&n,&k);
    for(i=0;i<26;i++)
        a[i]=0;
    scanf("%s",s);
    for(i=0;i<n;i++)
    {
        char c=s[i];
        a[c-'a']++;
    }
    for(i=0;i<26;i++)
    {
        if(a[i]>max)
            max=a[i];
    }
    if(max>k)
        printf("NO\n");
    else
        printf("YES\n");
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
	int n,k,s,i,max;
	char str[1000];
	while(scanf("%d%d",&n,&k)!=EOF)
	{
		int a[26]={0};
		max=0;
		getchar();
		gets(str);
		s=strlen(str);
		for(i=0;i<s;i++)
            a[str[i]-'a']++;
            for(i=0;i<26;i++)
                max=(max>a[i])?max:a[i];
            if(max>k)
                printf("NO\n");
            else
                printf("YES\n");
	}
	return 0;
}

#include <stdio.h>
#include <string.h>

int main()
{
    int n, k, i, j, len, count, max = 0;
    scanf("%d%d", &n, &k);
    char s[n + 1];
    scanf("%s", s);
    len = strlen(s);

    for(i = 0; i < len; i++) {
        if(s[i] != '0') {
            for(j = i + 1, count = 1; j < len; j++) {
                if(s[j] != '0' && s[j] == s[i]) {
                    count++;
                    s[j] = '0';
                }
        }
        }
        if(count > max)
            max = count;
    }
    if(k < max)
        printf("NO\n");
    else
        printf("YES\n");
    return 0;
}

#include <stdio.h>
#include <string.h>

int
main()
{
	int n = 0;
	int k = 0;
	int i = 0;
	int len = 0;
	int flag = 1;

	int color[27] = { 0 };
	char s[101] = "";

	while ( scanf("%d%d", &n, &k) != EOF )
	{
		if ( n )
			scanf( "%s", s );

		len = strlen( s );

		for ( i = 0; i < len; i++ )
		{
			color[ s[i]-'a' ]++;

			if ( color[ s[i]-'a' ] > k )
			{
				flag = 0;
				break;
			}
		}

		if (flag)
		{
			printf( "YES\n" );
		}
		else
		{
			printf( "NO\n" );
		}

		memset( color, 0, sizeof(int) );
	}

	return 0;
}

#include<stdio.h>
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    int freq[256];
    for(int i=0;i<256;i++)
    {
        freq[i]=0;
    }
    for(int i=0;i<n;i++)
    {
        char ch;
        int ascii;
        scanf(" %c",&ch);
        ascii=(int)ch;
        freq[ascii]++;
    }
    int max=0;
    for(int j=0;j<256;j++)
    {
        if(freq[j]>max)
        max=freq[j];
    }
    if(max>k)
    printf("NO");
    else
    printf("YES");
    return 0;
}

#include <stdio.h>
#include <string.h>

int main()
{
    int n, f;

    scanf("%d %d", &n, &f);
    getchar();

    int c = 0, count[26] = {0}, boro = 0;
    char string[n+1];

    gets(string);

    while (string[c] != '\0')
    {
        if (string[c] >= 'a' && string[c] <= 'z')
            count[string[c]-'a']++;
        c++;
    }

    for (c = 0; c < 26; c++)
    {
        if (count[c] > boro)
        {
            boro = count[c];
        }
    }

    if(boro > f)
    {
        printf("NO");
    }
    else
    {
        printf("YES");
    }

    return 0;
}

#include<stdio.h>
int a[109];
char s[109],ch;

int main()
{
    int t,n,b,c=0,i,j,max=0;

    scanf("%d%d",&t,&n);
      scanf("%s",s);
       for(i=0;i<t;i++)
       {
           if(s[i]>=97&&s[i]<=122);
           a[s[i]-97]++;
       }

    for(j=0;j<26;j++)
    {
        if(a[j]>0&&a[j]>max)c=a[j];
        if(c>max)max=c;
    }
    if(max>n){printf("NO");return 0;}
    else printf("YES");return 0;
}

#include<stdio.h>
int main()
{
    int n,k,count=1,count1=1,i,j;
    scanf("%d %d",&n,&k);
    char ch[n+1];
    scanf("%s",ch);
    for(i=0;i<n;i++)
    {
        for(j=i+1;j<n;j++)
        {
            if(ch[i]==ch[j])
            {
                count++;
            }
        }
        if(count>count1)
        {
            count1=count;
        }
        count=1;
    }
    if(count1<=k)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include <stdio.h>
#define MAX 26
#define SIZE 107

int main()
{
	int n, k, a[MAX], i, flag = 0;
	char str[SIZE];
	for(i=0;i<MAX;++i)
	{
		a[i] = 0;
	}
	scanf("%d %d", &n, &k);
	scanf("%s", str);
	for(i=0;i<n;++i)
	{
		++a[str[i] - 'a'];
	}
	for(i=0;i<MAX;++i)
	{
		if(a[i] > k)
		{
			flag = 1;
			break;
		}
	}
	if(flag)
	{
		printf("NO\n");
	}
	else
	{
		printf("YES\n");
	}
	return 0;
}

#include <stdio.h>
#define MAX 101

char balls[MAX][MAX];
int main (void)
{
	int balloons, friends;
	scanf ("%d %d\n", &balloons, &friends);
	int new_color;
	char c;
	new_color = 1;
	int i, j;
	for (i = 0; i < friends; i++)
		balls[i][0] = '\0';
	while ((c = getchar()) != EOF)
		for (i = 0; i < friends; i++){
			int j;
			for (j = 0; balls[i][j] != '\0'; j++)
				if (c == balls[i][j]){
					new_color = 0;
					break;
				}
			if (new_color == 1){
				balls[i][j] = c;
				balls[i][j + 1] = '\0';
				break;
			}

			if (i == friends - 1 && new_color == 0){
				puts("NO\n");
				return 0;
			}
			new_color = 1;
		}
	puts("YES\n");
	return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i,d;
    scanf("%d %d",&n,&k);
    char s[n];
    int a[26];
    for(i=0;i<26;i++)
        a[i]=0;
    scanf("%s",s);
     for(i=0;i<n;i++)
     {
         d=(int)(((int)s[i]-(int)97));
         a[d]++;
     }
     for(i=0;i<26;i++)
     {
         if(a[i]>k)
         {
             printf("NO\n");
             return 0;
         }
     }
     printf("YES\n");
  return 0;
}

#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main()
{
    int i,j ,n,k,flag=1;

    scanf("%i %i",&n,&k);
    char *s=malloc(n*sizeof(char));
    scanf("%s",s);
    int count[26]={0};
    for(i=0;s[i]!='\0';i++)
    {
        count[s[i]-'a']++;

    }
    for(i=0;i<26;i++)
    {
        if(count[i]>k)
        {printf("NO\n");
        flag=0;
        break;}
    }
    if(flag==1)
        printf("YES");
    return 0;
}

#include <stdio.h>

int main(void){
	int n, k;
	scanf("%d%d",&n,&k);
	char color[n+2];
	scanf("%s",color);
	if(k>=n){
		printf("YES\n");
		return 0;
	}
	int a[26],i;
	for(i=0; i<26; i++){
		a[i] = 0;
	}
	for(i=0; i<n; i++){
		a[color[i] - 'a']++;
	}
	for(i=0; i<26; i++){
		if(a[i] > k){
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
}

/*
 *
 * A. Generous Kefa
 * time limit per test
 * 2 seconds
 * memory limit per test
 * 256 megabytes
 * input
 * standard input
 * output
 * standard output
 *
 * One day Kefa found n baloons. For convenience, we denote color of i-th baloon as si — lowercase letter of the Latin alphabet. Also Kefa has k friends. Friend will be upset, If he get two baloons of the same color. Kefa want to give out all baloons to his friends. Help Kefa to find out, can he give out all his baloons, such that no one of his friens will be upset — print «YES», if he can, and «NO», otherwise. Note, that Kefa's friend will not upset, if he doesn't get baloons at all.
 * Input
 *
 * The first line contains two integers n and k (1 ≤ n, k ≤ 100) — the number of baloons and friends.
 *
 * Next line contains string s — colors of baloons.
 * Output
 *
 * Answer to the task — «YES» or «NO» in a single line.
 *
 * You can choose the case (lower or upper) for each letter arbitrary.
 * Examples
 * Input
 *
 * 4 2
 * aabb
 *
 * Output
 *
 * YES
 *
 * Input
 *
 * 6 3
 * aacaab
 *
 * Output
 *
 * NO
 *
 * Note
 *
 * In the first sample Kefa can give 1-st and 3-rd baloon to the first friend, and 2-nd and 4-th to the second.
 *
 * In the second sample Kefa needs to give to all his friends baloons of color a, but one baloon will stay, thats why answer is «NO».
 *
 */

/*algorithms: count the times of every color balloons; if every color balloons not greater than the total person, then can find a way to assign all of them to person and nobody recieve the same color, otherwise, there must a man recieve the same color*/
#include <stdio.h>
int main() {
    int count[26];  /*save every letter's appearance times*/
    int i, total, person;
    scanf("%d %d", &total, &person);
    getchar();
    for(i = 0; i < 26; i++)
        count[i] = 0;
    for(i = 0; i < total; i++)
        count[(getchar()) - 'a']++;
    for(i = 0; i < 26; i++)
        if(count[i] > person) {
            printf("NO");
            return 0;
        }
    printf("YES");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#define Num 26
#define MaxNum 101

int main()
{
    int i,n,k,Flag=0,Colors[Num];
    char ColorsString[MaxNum];
    for(i=0;i<Num;i++){
        Colors[i]=0;
    }
    scanf("%d %d ",&n,&k);
    gets(ColorsString);
    for(i=0;i<n;i++){
        Colors[ColorsString[i]-97]++;
    }
    for(i=0;i<Num;i++){
        if(Colors[i]>k){
            printf("NO");
            Flag=1;
            break;
        }
    }
    if(Flag==0){
        printf("YES");
    }

    return 0;
}

#include <stdio.h>

int main()
{
    int n, k, max = 0, cnt[26] = {0};
    char c;

    scanf("%d%d\n", &n, &k);
    while(c = getchar(), c != EOF && c != '\n')
    {
        cnt[c - 'a']++;
        if(max < cnt[c - 'a']) max = cnt[c - 'a'];
    }
    if(max > k) puts("NO");
    else puts("YES");

    return 0;
}

#include <stdio.h>
#include <string.h>

int main()
{
	int n, k;
	scanf("%d %d", &n, &k);
	char ar[n];
	scanf("%s", ar);
	int charfreq[26], i;
	for(i = 0; i < 26; i++)
		charfreq[i] = 0;
	for(i = 0; i < n; i++)
		charfreq[ar[i] - 'a']++;
	for(i = 0; i < 26; i++)
		if(charfreq[i] > k)
		{
			printf("NO\n");
			return 0;
		}
	printf("YES\n");
	return 0;
}

#include <stdio.h>
const char M = 102;
const char A = 26;
int main(){
    int n,k,i;
    char s[M],a[A],ans=1;
    for (i=0;i<A;i++)
        a[i]=0;
    scanf("%i%i%100s",&n,&k,s);
    for(i=0;i<n;i++){
        a[s[i]-'a']++;
    }
    for(i=0;i<A;i++){
        if(a[i]>k)
            ans = 0;
    }
    if(ans)
        printf("YES");
    else
        printf("NO");

    return 0-0-0;
}

#include<stdio.h>

int main(){
    int i,j,baloon, friends,lable[26];
    char baloons[100];

    for(i=0;i<26;i++) lable[i]=0;

    scanf("%d %d",&baloon,&friends);
    scanf(" ");
    gets(baloons);

    for(i=0;i<baloon;i++) lable[baloons[i]-'a']++;

    for(i=0;i<26;i++){
        if(lable[i]>friends){
            printf("NO");
            return 0;
        }
    }

    printf("YES");
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
 int n,k;char s[100000];
 scanf("%d %d",&n,&k);
 scanf("%s",&s);
 for(int i=0;i<n;i++)
 {

  int count=0;
  for(int j=i+1;j<n;j++)
     {
       if(s[i]==s[j]) count++;
     }
  if(count>=k) {printf("NO");break;}
   if(i==(n-1)){printf("YES");break;}
 }
return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int n,k,count,i=0,j=0;
    scanf("%d%d",&n,&k);
    char s[110];
    scanf("%s",&s);

    while(s[i]!='\0')
    {
        count=1;
        j=i+1;
        while(s[j]!='\0')
        {
            if(s[i]==s[j])
                count++;
            j++;
        }
        if(count>k)
        {
            printf("NO\n");
            return 0;
        }
        i++;
    }
    printf("YES\n");
}

#include<stdio.h>
int main()
{
    int n,k,j;
    scanf("%d %d",&n,&k);
    char c='a',s[n+1],x;
    scanf("%c",&x);
    gets(s);
    for(c='a'; c<='z'; c++)
    {
        j=0;
        for(int i=0; s[i];i++)

        {
            if(s[i]==c)
            {
                j++;
                if(j>k)
                {
                    printf("NO");
                    return 0;
                }
            }
        }
    }
    printf("YES");
}

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>

int cmpfunc (const void * a, const void * b)
{
    return ( *(int*)a - *(int*)b );
}

main()
{
    int T, r, i, x, b, n, k;
    long long fb;
    scanf("%d %d", &n, &k);

    char a[n];
    int cnt[26];

    for(i = 0; i<26; i++)
        cnt[i] = 0;

    for(i = 0; i<n; i++)
    {
        scanf(" %c", &a[i]);
        cnt[a[i]-'a']++;
    }

    for(i = 0; i<26; i++)
    {
        if(cnt[i]>k)
        { printf("NO");
        return 0;}
    }

    printf("YES");

}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main()
{
  int n,k,i,j,count=0,tem,min=100000000;
  char s[1000];

  scanf("%d %d",&n,&k);
  scanf("%s",s);

  for(i=0;i<strlen(s);i++)
  {
      for(j=i+1;j<strlen(s);j++)
      {
          if(s[i]>s[j])
          {
              tem=s[i];
              s[i]=s[j];
              s[j]=tem;
          }
      }

  }

  count=1;
  for(i=0;i<strlen(s)-1;i++)
  {
          if(s[i]!=s[i+1])
          {
            count++;
          }
  }

  int symbolcount[count];
  for(int i=0;i<count;i++)
  {
    symbolcount[i]=1;
  }
  for(int i=0,j=0;i<count && j<strlen(s)-1;j++)
  {
    if(s[j]==s[j+1]) symbolcount[i]++;
    else i++;
  }
  for(int i=0;i<count;i++)
  {
    if(k<symbolcount[i])
    {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
}

#include<stdio.h>
int count[26];
int main()
{
    char c;
    int n, k;
    int i, flag=1;
    scanf("%d%d%*c", &n, &k);
    while(n--)
    {
        scanf("%c", &c);
        count[c-'a']++;
    }
    for(i=0; i<26; i++)
    {
        if(!count[i]) continue;
        if(count[i]>k)
        {
            flag = 0;
            break;
        }
    }
    if(flag) puts("YES");
    else puts("NO");
    return 0;
}

#include<stdio.h>
#include<stdio.h>
#include<string.h>
int main()
{
  char s[10000];
  int i,n,k,count[1000],flag;
  scanf("%d%d",&n,&k);
  scanf("%s",s);
  for(i=0;i<n;i++){
    count[s[i]-'a']++;
  }
  flag=0;
  for(i=0;i<26;i++){
    if(count[i]>k){
     flag=1;
    }
  }
  if(flag==1)
    printf("NO\n");
  else printf("YES\n");
  return 0;
}

#include <stdio.h>

int main() {
    int n, k;
    scanf("%i%i\n", &n, &k);
    char current_character;
    int q[30];
    for (int i = 0; i < 30; i++)
        q[i] = 0;
    for (int i = 0; i < n; i++) {
        scanf("%c", &current_character);
        q[current_character - 'a']++;
    }
    int maximal_letter_count = 0;
    for (int i = 0; i < 30; i++)
        if (q[i] > maximal_letter_count)
            maximal_letter_count = q[i];
    printf(maximal_letter_count > k ? "NO" : "YES");
    return 0;
}

#pragma warning(disable:4996)
#include <stdio.h>
#include <malloc.h>
#include <math.h>
#include <stdlib.h>
#define N 100
#define EPS 1E-5
int lol(const void *x1, const void *x2)
{
	return *(int*)x1 - *(int*)x2;
}

int main(void)
{
	int i, n, k,count = 0, temp,ch[26] = { 0 };
	int max1 = 0, max2 = 0;
	char c;
	scanf("%i%i", &n, &k);
	scanf("%c", &c);
	do
	{
		scanf("%c", &c);
		if (c != '\n')
			ch[c - 'a']++;
	} while (c != '\n');
	for (i = 0; i < 26; i++)
	{
		if (ch[i] > max1)
		{
			max2 = max1;
			max1 = ch[i];
		}
		else if (ch[i] > max2)
			max2 = ch[i];
	}
	if (max2 == 0)
	{
		if (max1 <= k)
			printf("YES");
		else
			printf("NO");
	}
	else
	{
		temp = k - max2;
		if (temp < 0)
			printf("NO");
		else if (temp == 0)
		{
			if (max2 == max1)
				printf("YES");
			else
				printf("NO");
		}
		else
		{
			for (i = 0; i < 26; i++)
			{
				if (ch[i] != 0)
				{
					ch[i] -= max2;
					if (ch[i] > temp)
					{
						printf("NO");
						return 0;
					}
				}
			}
			printf("YES");
		}

	}
	return 0;
}

#include<stdio.h>

int main()
{
    int n,k,max=0,count=0;
    scanf("%d%d",&n,&k);
    //int ar[n]
    char s[n+1];
    s[n]='\0';
    scanf("%s",s);
    if(k>=n)
    printf("%s","YES");
    else
    {
    for(int i=0;i<n;i++)
    {
    if(s[i]!='0')
    {
    count=1;
    for(int j=i+1;j<n;j++)
    {
    if(s[i]==s[j])
    {
    count++;
    s[j]='0';
    }
    }
    if(count>max)
    max=count;
    }
    }
    if(max>k)
    printf("%s","NO");
    else
    printf("%s","YES");
    }

    //printf("%d",max);
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int i,c=0,a=97,n,k,j;
        int max=0;

    scanf("%d%d",&n,&k);
       char s[n];
    scanf("%s",s);

    for(;a<='z';a++)
    {
        for(i=0;i<strlen(s);i++)
        {
            if(s[i]==a)
                c++;
                if(c>max)
                    max=c;
        }
        c=0;

    }
    if(max<=k)
        printf("YES");
        else printf("NO");
}

#include <stdio.h>
#include <string.h>

int arr[26];

int main()
{
    int n, k, i;
    char str[101];
    scanf("%d %d %s", &n, &k, str);

    for(i=0; i<n; i++)
        arr[str[i]-'a']++;

    for(i=0; i<26; i++){
        if(arr[i] > k){
            printf("NO");
            return 0;
        }
    }
    printf("YES");

    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int n,k,i,ascii[123];
    for(i=65;i<123;i++)ascii[i]=0;
    char bal[100];
    scanf("%d %d",&n,&k);
    scanf("%s",bal);
    for(i=0;i<n;i++)ascii[bal[i]]++;
    for(i=65;i<=122;i++)
    {
        if(ascii[i]>k)
        {
            printf("NO");
            return 0;
        }
    }
    printf("YES");
}

#include<stdio.h>
#include<string.h>
int main()
{
    int n,k,j,c[27]={0},i,f=0;
    char s[1000];
    scanf("%d %d %s",&n,&k,s);
    for(i=0;i<strlen(s);i++)
    {
        c[s[i]-'a']++;
        }
        for(i=0;i<27;i++)
        {
            if(c[i]>k)
                f++;
        }

    if(f>0)
        printf("NO");
    else printf("YES");

}

#include<stdio.h>
int main(void)
{
    int i,m=0,n,k,freq[26]={0};
    scanf("%d %d",&n,&k);
    int pos[n];
    char string[n+2];
    scanf("%s",string);
    for(i=0;string[i]!='\0';i++)
    {
        if(!freq[string[i]-97])
        {
            pos[m]=string[i]-97;
            m++;
        }
        freq[string[i]-97]++;
    }
    for(i=0;i<m;i++)
    {
        if(freq[pos[i]]>k)
        {
            n=1;
            break;
        }
        else
            n=0;
    }
    if(n)
        printf("%s\n","NO");
    else
        printf("%s\n","YES");
    return 0;
}

#include <stdio.h>

int main()
{
    int n, k, i;
    scanf("%d%d", &n, &k);

    char str[101];
    scanf(" %s", str);

    int colors[26]={0};

    for(i=0; i<n; i++){
        colors[str[i]-'a']++;
    }

    for(i=0; i<26; i++){
        if(colors[i]>k){
            printf("NO\n");
            return 0;
        }
    }

    printf("YES\n");

    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
int n,k,i,l,j=0,c,max=0;
scanf("%d %d",&n,&k);
char s[100];
scanf("%s",s);
l=strlen(s);
for(i=0;i<l;i++){
        c=1;
 for(j=i+1;j<l;j++){
   if(s[i]==s[j]){
   c++;
   s[j]='0';
   }
if(c>max){
 max=c;

 }

 }
}

 if(k>=max){
 printf("YES");
  return 0;
 }
 else
 {
 printf("NO");
 return 0;
 }
}

#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{
    int n,k;
    scanf("%d %d",&n,&k);getchar();
    char s[n+1];
    int i,a[26]={0};
    gets(s);
    for(i=0;i<strlen(s);i++){
        a[s[i]-'a']++;
    }
    int p[100]={0},j,flag=0;
    for(i=0;i<k;i++){
        for(j=0;j<26;j++){
         if(a[j]!=0){
            p[i]++;a[j]--;
         }
         if(p[i]==2)break;
        }
        if(p[i]<2)flag=1;

    }
    for(i=0;i<26;i++){
        if(a[i]!=0)flag=1;
    }
    if(flag==1)printf("NO");
    else printf("YES");
    return 0;
}

#include<stdio.h>
int main()
{
	int n,k,i,max,a[26];
	char str[1000];
	while(scanf("%d%d",&n,&k)!=EOF)
	{
	    max=0;
	    getchar();
		gets(str);
		for(i=0;str[i]!='\0';i++)
            a[str[i]-'a']++;
            for(i=0;str[i]!='\0';i++)
                max=(max>a[i])?max:a[i];
            if(max>k)
                printf("NO\n");
            else
                printf("YES\n");
	}
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main() {

	int n, p,k,pojava[200],i;
	char tekst[110];

	scanf("%d %d", &n, &k);
	scanf("%s", tekst);
	p = 1;
	for (i = 0; i < n; i++) {
		pojava[tekst[i]]++;
		if (pojava[tekst[i]] > k) { p = 0; break; }
	}

	if (p) printf("YES\n");
	else printf("NO\n");

	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    char b[1000],a[1000];
    int i,j,n,k,c=0;
    scanf("%d %d",&n,&k);
    gets(b);
     gets(a);
    for(i=0;a[i]!='\0';i++)
    {
        for(j=0;j<i;j++)
        {
            if(a[i]==a[j])
            {
                break;
            }
        }
        if(a[i]==a[j]&&i!=0)
            continue;
        else if(j==i)
        {
            for(;j<n;j++)
            {
                if(a[i]==a[j])
                {
                    c++;
                }
            }
        }
        if(c>k)
        {
            printf("NO");
            break;
        }
    }
    if(i==n&&c<=k)
        printf("YES");
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    char s[1001];
    int n,i,j,c,d,k;
    scanf("%d %d",&n,&c);
    scanf("%s",s);
    for (i=0;i<n; i++)
    {
        d=1;
        for (j=1; j<n; j++)
        {
            if (s[i]==s[j])
            {
                d++;

            }
            if (d>c)
            {
                printf("NO");
                return 0;
            }
        }
    }
    printf("YES");
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main()
{
  int n,k,i,j,count=0,tem,min=100000000;
  char s[1000];

  scanf("%d %d",&n,&k);
  scanf("%s",s);

  for(i=0;i<strlen(s);i++)
  {
      for(j=i+1;j<strlen(s);j++)
      {
          if(s[i]>s[j])
          {
              tem=s[i];
              s[i]=s[j];
              s[j]=tem;
          }
      }

  }

//printf("%s\n",s);
  count=1;
  for(i=0;i<strlen(s)-1;i++)
  {
          if(s[i]!=s[i+1])
          {
            count++;
          }
  }
  if(count<k)
  {
    printf("NO\n");
    return 0;
  }

  int symbolcount[count];
  for(int i=0;i<count;i++)
  {
    symbolcount[i]=1;
  }
  for(int i=0,j=0;i<count && j<strlen(s)-1;j++)
  {
    if(s[j]==s[j+1]) symbolcount[i]++;
    else i++;
  }
  for(int i=0;i<count;i++)
  {
    if(k%symbolcount[i]!=0)
    {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");

}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int n, k, i, j, t=0, m;
    scanf("%d %d", &n, &k);
    char a[n+5];
    scanf("%s", a);
    for(i=0;i<strlen(a);i++)
    {
        for(j=0;j<strlen(a);j++)
        {
            if(a[i]!=a[j]&&a[i]!='1'&&a[j]!='1')
            {
                t++;
                a[i]='1';
                a[j]='1';
                break;
            }
        }
    }
   // printf("%d\n",t);
    if(2*t==n)
    {
        if(k>=t)
            printf("YES\n");
        else
            printf("NO\n");
    }
    else
    {
        m = n - 2*t;
        if(m<=(k-t))
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int n,k,count=1,count1=1,i,j;
    scanf("%d %d",&n,&k);
    char ch[n+1];
    scanf("%s",ch);
    for(i=0;i<n;i++)
    {
        for(j=i+1;j<n;j++)
        {
            if(ch[i]==ch[j])
            {
                count++;
            }
        }
        if(count>count1)
        {
            count1=count;
            count=1;
        }
    }
    if(count1<=k)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>
#include<string.h>
int main(void){
    int n,k,l,i;
    char s[101];
    int A[26];

    scanf("%d%d",&n,&k);
    scanf("%s",s);
    l=strlen(s);
    for(i=0;i<l;i++){
	A[s[i]-'a']++;
    }
    for(i=0;i<26;i++){
	if(A[i]>k){
	    printf("NO\n");
	    return 0;
	}
    }
    printf("YES\n");
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    char s[205];
    int n,k,min=0,j,i,c,l;
    scanf("%d %d",&n,&k);
    scanf("%s",&s);
    l=strlen(s);
    min=50;
    int a[l];
    for(i=0;i<l;i++)
    {  c=0;
       for(j=0;j<l;j++)
       {
           if(s[i]==s[j])
           {
              c=c+1;
           }
       }
       a[i]=c;
    }
    for(i=0;i<l-1;i++){if(a[i]>=min){min=a[i];}}

    if(min>k)
    {
        printf("NO");
    }
    else if(k==2&&l==2)
    {
        printf("YES");
    }
    else {
        printf("YES");
    }
    return 0;
}

#include <stdio.h> //3번
#pragma warning(disable:4996)

int main(void) {
 int N, k, i;
 char p;
 int str[26] = { 0, };
 scanf("%d%d", &N, &k);

 for (i = 0; i<N; i++) {
  scanf(" %c", &p);
  if (p <= 'z' && p >= 'a') {
   ++str[p - 'a'];
  }
  else break;
 }
 for (i = 0; i<N; i++) {

  if (str[i]>k) {
   printf("NO\n");

   return 0;
  }
 }

 printf("YES\n");

 return 0;
}

#include<stdio.h>
#include<conio.h>
int main()
{
	int n,k,i,j,c;c=0;
	char s[100];
	scanf("%d%d\n",&n,&k);
	scanf("%s",s);
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			if(s[i]!=s[j]&& s[i]!=0)
			{
				c++;
				s[i]=0;s[j]=0;
			}
		}
	}
	if(c==n/k)
	printf("yes");
	else printf("no");
}

#include<string.h>
int main()
{
int n,k,i,l,j=0,c;
scanf("%d %d",&n,&k);
char s[100];
scanf("%s",&s);
l=strlen(s);
for(i=0;i<l;i++){
        c=0;
 for(j=i+1;j<l;j++){
   if(s[i]==s[j]){
   c++;
   }

 }
 if(c<=k){
 printf("YES");
  return 0;
 }
 else
 {
 printf("NO");
 return 0;
 }

}

}

#include<stdio.h>
#include<conio.h>
int main()
{
	int n,k,i,j,c;c=0;
	char s[100];
	scanf("%d%d\n",&n,&k);
	scanf("%s",s);
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			if(s[i]!=s[j]&& s[i]!=0)
			{
				c++;
				s[i]=0;s[j]=0;
			}
		}
	}
	if(c==k)
	printf("yes");
	else printf("no");
}

#pragma warning(disable:4996)
#include <stdio.h>
#include <malloc.h>
#include <math.h>
#include <stdlib.h>
#define N 100
#define EPS 1E-5
int lol(const void *x1, const void *x2)
{
	return *(int*)x1 - *(int*)x2;
}

int main(void)
{
	int i, n, k,count = 0, temp,ch[26] = { 0 };
	int max1 = 0, max2 = 0;
	char c;
	scanf("%i%i", &n, &k);
	scanf("%c", &c);
	do
	{
		scanf("%c", &c);
		if (c != '\n')
			ch[c - 'a']++;
	} while (c != '\n');
	for (i = 0; i < 26; i++)
	{
		if (ch[i] > max1)
		{
			max2 = max1;
			max1 = ch[i];
		}
		else if (ch[i] > max2)
			max2 = ch[i];
	}
	if (max2 == 0)
	{
		if (max1 == k)
			printf("YES");
		else
			printf("NO");
	}
	else
	{
		temp = k - max2;
		if (temp < 0)
			printf("NO");
		else if (temp == 0)
		{
			if (max2 == max1)
				printf("YES");
			else
				printf("NO");
		}
		else
		{
			for (i = 0; i < 26; i++)
			{
				if (ch[i] != 0)
				{
					ch[i] -= max2;
					if (ch[i] > temp)
					{
						printf("NO");
						return 0;
					}
				}
			}
			printf("YES");
		}

	}
	return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    char s[205];
    int n,k,min=105,j,i,c,l;
    scanf("%d %d",&n,&k);
    scanf("%s",&s);
    l=strlen(s);
    min=50;
    int a[l];
    for(i=0;i<l;i++)
    {  c=0;
       for(j=0;j<l;j++)
       {
           if(s[i]==s[j])
           {
              c=c+1;
           }
       }
       a[i]=c;
    }
    for(i=0;i<l-1;i++){if(a[i]<=min){min=a[i];}}

    if(min>=k)
    {
        printf("YES");
    }
    else {
        printf("NO");
    }
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
  char s[10000];
  int i,n,k,count[1000];
  scanf("%d%d",&n,&k);
  scanf("%s",s);
  for(i=0;i<n;i++){
    count[s[i]-'a']++;
  }
  for(i=0;i<26;i++){
    if(count[i]==count[i+1]){
  printf("YES");
  break;
    }
  else {
    printf("NO");
    break;
  }
}
return 0;
}

#include<stdio.h>
int main()
{
    int n,k,i,j,d;
    scanf("%d %d",&n,&k);
    char s[n];
    int a[26]={0};
    scanf("%s",s);
     for(i=0;i<n;i++)
     {
         d=(int)'a'-(int)s[i];
         a[d]++;
     }
     for(i=0;i<26;i++)
     {
         if(a[i]>k)
         {
             printf("NO\n");
             return 0;
         }
     }
     printf("YES\n");
  return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int n, k, i, j, t=0, m;
    scanf("%d %d", &n, &k);
    char a[n+5];
    scanf("%s", a);
    for(i=0;i<strlen(a);i++)
    {
        for(j=0;j<strlen(a);j++)
        {
            if(a[i]!=a[j]&&a[i]!='1'&&a[j]!='1')
            {
                t++;
                a[i]='1';
                a[j]='1';
                break;
            }
        }
    }
    printf("%d\n",t);
    if(2*t==n)
    {
        if(k>=t)
            printf("YES\n");
        else
            printf("NO\n");
    }
    else
    {
        m = n - 2*t;
        if(m<=(k-t))
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}

#include <stdio.h>

int main()
{
	int b_cnt = 'z' - 'a' + 1;
	int	b_mas[ b_cnt ];
	memset( b_mas, 0, sizeof( b_mas ));
	int n,k,i;
	scanf( "%d %d", &n, &k );
	int ans = 1;
	for ( i=0; i < n; i++ ) {
		char sym;
		scanf( "%c", &sym );
		b_mas[sym - 'a']++;
	}
	for ( i=0; i < n; i++ ) {
		if ( b_mas[i] > k ) {
			ans = 0;
			break;
		}
	}
	printf("%s\n", ans ? "YES" : "NO");
}

#include <stdio.h>

int main() {
    int n, k;
    scanf("%i%i", &n, &k);
    char current_character;
    int q[30];
    for (int i = 0; i < 30; i++)
        q[i] = 0;
    for (int i = 0; i < n; i++) {
        scanf("%c", &current_character);
        q[current_character - 'a']++;
    }
    int maximal_letter_count = 0;
    for (int i = 0; i < 30; i++)
        if (q[i] > maximal_letter_count)
            maximal_letter_count = q[i];
    printf(maximal_letter_count > k ? "NO" : "YES");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main(){
	int n, k, i, aux = 0;
	char *ballons;
	char alphabet[125];

	for(i=0;i<125;i++){
		alphabet[i] = 0;
	}

	scanf("%d %d", &n, &k);

	ballons = (char *) malloc(n*sizeof(char));

	scanf("%s", ballons);

	for(i=0;ballons[i]!='\0';i++){
		alphabet[ballons[i]]++;
	}

	for(i=0;i<125;i++){
		if(alphabet[i]%k!=0){
			aux = 1;
			break;
		}
	}

	if(aux == 1) printf("NO\n");
	else printf("YES\n");

	return 0;
}
/* 1506095938943 */

#include<stdio.h>
int n, k, i;
char a[100];//������ɫ
int b[26];//��26��������ɫ  ������26�������г�ʼ��Ϊ0
int main()
{
	//int n, k, i;
	//char a[100];//������ɫ
	//int b[26];//��26��������ɫ  ������26�������г�ʼ��Ϊ0
	scanf("%d%d", &n, &k); //n��ʾ��������  k��ʾ��������
	scanf("%s", a + 1);
	for (i = 1; i <= n; i++) //ѭ��n�� ���ж��ٸ�������ɫ
	{
		b[a[i] - 'a']++; //�����ݴ�����b[26]�� ������ĸa��z��ÿ����ĸ�������ֱ��Ƕ���
	}
	for (i = 0; i < 26; i++)//���������ĸ�У��ٴ�a - z�������һ��������ɫ���������������� ֱ��no
	{
		if (b[i] > k)
		{
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	return 0;
}

#include<stdio.h>
#include<string.h>

int main()
{
	int n, k;
	char a[105];

	int count[105] = { 0 };
	char A[105];
	int L;

	scanf("%d%d", &n, &k);
	getchar();
	scanf("%s", a);

	L = 0;
	for (int i = 0; a[i] != '\0'; i++)
	{
		int flag = 1;

		for (int j = 0; j < i; j++)
		{
			if (a[i] == a[j])
			{
				flag = 0;
				break;
			}
		}

		if (flag == 1)
		{
			A[L] = a[i];
			count[L]++;
			L++;
		}

		if (flag == 0)
		{
			for (int j = 0; j < i; j++)
			{
				if (a[i] == A[j])
				{
					count[j]++;
					break;
				}
			}
		}
	}

	int max = count[0];
	for (int i = 0; i < L; i++)
	{
		if (count[i] > max)
		{
			max = count[i];
		}
	}

	if (max > k || n < k)
	{
		printf("NO");
	}
	else
	{
		printf("YES");
	}

	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a['z']={0},n,k;
    scanf("%d %d",&n,&k);
    char s[1000];
    scanf("%s",&s);
    int i,j,x;
    for(i=0;s[i]!='\0';i++)
    {
        char z=s[i];
        a[z]++;
    }
    x=n/k;
    char d;
    for(d='a';d<'z';d++)
    {
        int y=a[d];
        if(x<y)
         {
             printf("NO\n");
             return 0;
         }
    }
    printf("YES\n");
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
int n,k,i,l,j=0,c,max=0;
scanf("%d %d",&n,&k);
char s[100];
scanf("%s",s);
l=strlen(s);
for(i=0;i<l;i++){
        c=1;
 for(j=i+1;j<l;j++){
   if(s[i]==s[j]){
   c++;
   s[j]='0';
   }
if(c>max){
 max=c;

 }

 }
}

 if(k>=max){
 printf("YES");
  return 0;
 }
 else
 {
 printf("NO");
 return 0;
 }
}

#include<stdio.h>
#include<string.h>
char s[201];
int a[26];
int main()
{
 int n,k;
 scanf("%d%d%s",&n,&k,s);
 for(int i=0;i<n;i++)
 {
  a[s[i]-'a']++;
 }
 for(int i=0;i<26;i++)
 {
   if(a[i]>k)
   return puts("NO"),0;puts("YES");
 }
 return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
int n,k,i,l,j=0,c,max=0;
scanf("%d %d",&n,&k);
char s[100];
scanf("%s",&s);
l=strlen(s);
for(i=0;i<l;i++){
        c=1;
 for(j=i+1;j<l;j++){
   if(s[i]==s[j]){
   c++;
   s[j]='0';
   }
if(c>max){
 max=c;

 }

 }
}

 if(max<=k){
 printf("YES");
  return 0;
 }
 else
 {
 printf("NO");
 return 0;
 }
}

#include<stdio.h>
#include<stdlib.h>
int main() {
	int balloon, amigo;
	char* arr;
	int i, j;
	int temp=1;
	int max = 0;

	scanf("%d %d", &balloon, &amigo);
	if (balloon < 1 || amigo>100) {
		return 0;
	}

	arr = (char*)malloc(sizeof(char)*balloon);

	for (i = 0; i < balloon; i++) {
		scanf("%c", &arr[i]);
	}

	for (i = 0; i < balloon-1; i++) {
		temp = 1;
		for (j = i+1; j < balloon; j++) {
			if ((arr[i] == arr[j])!=NULL) {
				arr[j] = NULL;
				temp++;
			}
		}
		if (temp >= max)
			max = temp;
	}

	if (max > amigo) {
		printf("NO\n");
		return 0;
	}
	else
		printf("YES\n");

	return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
int n,k,i,l,j=0,c;
scanf("%d %d",&n,&k);
char s[100];
scanf("%s",&s);
l=strlen(s);
for(i=0;i<l;i++){
        c=1;
 for(j=i+1;j<l;j++){
   if(s[i]==s[j]){
   c++;
   }

 }
 if(c==k){
 printf("YES");
  return 0;
 }
 else
 {
 printf("NO");
 return 0;
 }

}

}

#include <stdio.h>

int cnt[26];

int main(void)
{
	int n, k, a, num = 0;
	char c;
	scanf("%d %d", &n, &k);
	getchar();
	for (a = 0; a < n; a = a + 1)
	{
		c = getchar();
		cnt[c - 'a']++;
	}
	for (a = 0; a < 26; a = a + 1)
	{
		if (cnt[a])
			num++;
		if (cnt[a] && cnt[a] != n)
		{
			num = -1;
			puts("NO");
			break;
		}
	}
	if (num != -1 && num < n)
		puts("NO");
	else if(num!=-1)
		puts("YES");
	return 0;
}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main()
{
  int n,k,i,j,count=0,tem,min=100000000;
  char s[1000];

  scanf("%d %d",&n,&k);
  scanf("%s",s);

  for(i=0;i<strlen(s);i++)
  {
      for(j=i+1;j<strlen(s);j++)
      {
          if(s[i]>s[j])
          {
              tem=s[i];
              s[i]=s[j];
              s[j]=tem;
          }
      }

  }

//printf("%s\n",s);
  count=1;
  for(i=0;i<strlen(s)-1;i++)
  {
          if(s[i]==s[i+1])
          {

            count++;

          }
          else
          {
              if(min>count)
              {
                  min=count;

              }
              count=1;
          }

  }
 // printf("%d\n",min);
  if(min<k)
  {
      printf("NO");
  }
  else
  {
      printf("YES");
  }
  return 0;

}

#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{
    int n,k;
    scanf("%d %d",&n,&k);getchar();
    char s[n+1];
    int i,a[26]={0};
    gets(s);
    for(i=0;i<strlen(s);i++){
        a[s[i]-'a']++;
    }
    int p[1000]={0},j,flag=0;
    for(i=0;i<k;i++){
        for(j=0;j<26;j++){
         if(a[j]!=0){
            p[i]++;a[j]--;
         }
         if(p[i]==2)break;
        }
        if(p[i]<2)flag=1;

    }
    for(i=0;i<26;i++){
        if(a[i]!=0)flag=1;
    }
    for(i=0;i<k;i++){
        if(p[i]!=2)flag=1;
    }
    if(flag==1)printf("NO");
    else printf("YES");
    return 0;
}

#include <stdio.h>
#include <string.h>

char in_abc(char sym, char* abc) {
	int i;
	for(i = 0; i < strlen(abc); ++i) {
		if(abc[i] == sym) {
			return 1;
		}
	}
	return 0;
}

int main() {
	int n, k;
	scanf("%d%d", &n, &k);
	char str[n];
	scanf("%s", str);
	char abc[n];

	int i;
	for(i = 0; i < n; ++i) {
		abc[i] = '\0';
	}

	int j = 0;
	for(i = 0; i < n; ++i) {
		if(!in_abc(str[i], abc)) {
			abc[j] = str[i];
			++j;
		}
	}

	int x;
	for(i = 0; i < strlen(abc); ++i) {
		x = 0;
		for(j = 0; j < n; ++j) {
			if(str[j] == abc[i]) {
				++x;
			}
		}
		if(x != k) {
			printf("NO");
			return 0;
		}
	}

	printf("YES");
	return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int n,k,b[105],flag=0;
    char s[105];
    memset(b,0,sizeof(b));
    scanf("%d%d%s",&n,&k,s);
    for(int i=0;i<n;i++)
    {
        b[s[i]-'0']++;
    }
    if(k==1)
    {
        for(int i=40;i<=100;i++)
            if(b[i]>=2)
                flag=1;
        if(flag==1) printf("NO\n");
        else printf("YES\n");
    }
    else
    {
         for(int i=40;i<=100;i++)
            if(b[i]>2)
                flag=1;
        if(flag==1) printf("NO\n");
        else printf("YES\n");
    }
    return 0;
}

#include<stdio.h>

int main(){
    int i,j,baloon, friends,lable[256];
    char baloons[100];
    for(i=0;i<256;i++) lable[i]=0;
    scanf("%d %d",&baloon,&friends);
    gets(baloons);
    for(i=0;i<friends;i++) lable[baloons[i]]++;
    for(i=0;i<256;i++){
        if(lable[i]>friends){
            printf("NO");
            return 0;
        }
    }
    printf("YES");
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
int n,k,i,l,j=0,c,max=0;
scanf("%d %d",&n,&k);
char s[100];
scanf("%s",s);
l=strlen(s);
for(i=0;i<l;i++){
        c=1;
 for(j=i+1;j<l;j++){
   if(s[i]==s[j]){
   c++;
   s[i]='0';
   }
if(c>max){
 max=c;

 }

 }
}

 if(k>=max){
 printf("YES");
  return 0;
 }
 else
 {
 printf("NO");
 return 0;
 }
}

#include<stdio.h>
int main()
{
    int n,i,j,temp;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            if(a[i]<a[j]){
                temp=a[i];
                a[i]=a[j];
                a[j]=temp;
            }
        }
    }
    if(a[n/2]==a[(n/2)-1])
        printf("NO\n");
    else
        printf("YES\n");

    return 0;
}

#include <stdio.h>
#define MAX 101
typedef struct friend {
	char color[MAX];
	struct friend* next;
} friend;

friend frnd[MAX];

int check_and_write(friend* cur, char c){
	int i;
	for (i = 0; cur->color[i] != '\0'; i++)
		if (c == cur->color[i])
			return 0;
	cur->color[i] = c;
	return 1;
}

int main(void){
	friend* p = &frnd[0];
	int n, k, i;
	char c;
	scanf("%d %d\n", &n, &k);
	for (i = 0; i < MAX; i++){
		p->next = &frnd[i];
		p = p->next;
	}
	while ((c = getchar()) != EOF){
		for(p = &frnd[0]; p; p = p->next){
			if (check_and_write(p, c))
				break;
			if(p->next == NULL){
				puts("NO\n");
				return 0;
			}
		}
	}
	puts("YES\n");
	return 0;
}

#include<stdio.h>
#include<string.h>
main()
{
    int baloon,frnd,i,check[150],j,count;
    char color[150],c;
    while(scanf("%d %d",&baloon,&frnd)!=EOF)
    {
        j=0;
        scanf("%s",color);
        if(strlen(color)<frnd)
        {
            printf("YES\n");
            return 0;
        }
        for(c='a'; c<='z'; c++)
        {
            count=0;
            for(i=0; i<strlen(color); i++)
            {
                if(c==color[i])
                {
                    count++;
                }
            }
            if(count>0)
            {
                check[j]=count;
                j++;
            }
        }
        j--;
        while(j>=0)
        {
            if(check[j]<frnd)
            {
                printf("NO\n");
                return 0;
            }
            j--;
        }
        printf("YES\n");
    }
    return 0;
}

#include<stdio.h>
int main()
{
	int n,k,i,max;
	char str[1000];
	while(scanf("%d%d",&n,&k)!=EOF)
	{
		int a[26]={0};
	    max=0;
	    getchar();
		gets(str);
		for(i=0;i<26;i++)
            a[str[i]-'a']++;
            for(i=0;i<26;i++)
                max=(max>a[i])?max:a[i];
            if(max>k)
                printf("NO\n");
            else
                printf("YES\n");
	}
	return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
	int  n,k,j,i;
	int  mas[27];
	char s;
	for (i=0;i<=27;i++)
		mas[i]=0;
	scanf("%d %d",&n,&k);
	scanf("%c",&s);
	for (i=1;i<=n;i++)
	{
		scanf("%c",&s);
		mas[s-'a']++;
	}
	for (i=0;i<=27;i++)
		if (mas[i]>k)
		{
			printf("NO");
			return 0;
		}
	printf("YES");
	return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    char s[1001];
    int n,i,j,c,d,k;
    scanf("%d %d",&n,&c);
    scanf("%s",s);
    for (i=0;i<n; i++)
    {
        d=1;
        for (j=1; j<n; j++)
        {
            if (s[i]==s[j])
            {
                d++;

            }
            if (d>c)
            {
                printf("NO");
                return 0;
            }
        }
    }
    printf("YES");
    return 0;
}

#include <stdio.h>

int main() {
	int baloes, amigos, tabela[26] = {0}, i = 0;
	char cor[100];

	scanf("%d %d", &baloes, &amigos);
	scanf("%s", cor);
	while(cor[i] != '\0') {
		tabela[cor[i] - 97]++;
		if(tabela[cor[i] - 97] > 1);
		i++;
	}
	i = 0;
	while(i < 26) {
		if(tabela[i] > 1) {
			amigos--;
			tabela[i] -= 2;
		} else {
			i++;
		}
	}
	if(amigos != 0) printf("NO\n");
	else printf("YES\n");
	return 0;
}
/* 1506561488605 */

#include<stdio.h>
#include<string.h>
int main()
{
int n,k,i,l,j=0,c;
scanf("%d %d",&n,&k);
char s[100];
scanf("%s",&s);
l=strlen(s);
for(i=0;i<l;i++){
        c=0;
 for(j=i+1;j<l;j++){
   if(s[i]==s[j]){
   c++;
   }

 }
 if(c>k){
 printf("YES");
  return 0;
 }
 else
 {
 printf("NO");
 return 0;
 }

}

}

#include<stdio.h>
#include<stdlib.h>

int main(){
    int n,k;
    scanf("%d",&n);
    scanf("%d",&k);
    if(n<k){
        printf("NO");
        return 0;
    }
    char* arr = (char*)malloc(sizeof(char)*n);
    int i=0,x=0,y=0;
    for (i=0;i<n;i++){
        scanf("%c",&arr[i]);
    }
    int freq[26] ={0};
    for (i =0;i<n;i++){
        freq[(int)arr[i] - 'a']++;
    }
    for (i =0;i<26;i++){
        if(freq[i] > k) {
            printf("NO");
            return 0;
        }
    }
    printf("YES");

}

#include<stdio.h>
#include<string.h>
int main()
{
	int i,j,n,k,c=0,m=0;
	char b;
	b='a';
	scanf("%d%d",&n,&k);
	char a[n];

	scanf("%s",&a);

	for (i=0; i<n; i++){
                c=0;
		for (j=0; j<n; j++){
			if (a[j]==b) c++;
			if (c>k) {
				printf ("NO");
				m=1;
				break;
			}
		}
		b++;
	}
	if (m==0) printf("YES");
}

#include<stdio.h>
#include<string.h>
int main()
{
	int i,j,n,k,c=0,m=0;
	char b;
	b='a';
	scanf("%d%d",&n,&k);
	char a[n];

	scanf("%s",&a);

	for (i=0; i<n; i++){
                c=0;
		for (j=0; j<n; j++){
			if (a[j]==b) c++;
			if (c>k) {
				printf ("NO");
				m=1;
				break;
			}
		}
                if (m==1) break;
		b++;
	}
	if (m==0) printf("YES");
        return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int n, k, i, j, t=0;
    scanf("%d %d", &n, &k);
    char a[n+5];
    scanf("%s", a);
    for(i=0;i<strlen(a);i++)
    {
        for(j=0;j<strlen(a);j++)
        {
            if(a[i]!=a[j]&&a[i]!='1'&&a[j]!='1')
            {
                t++;
                a[i]='1';
                a[j]='1';
            }
        }
    }
    //printf("%d\n",t);
    if(t>=k)
        printf("YES\n");
    else
    {
        if(2*t==n||(2*t<n&&n-2*t<2))
          printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}

#include <stdio.h>

int main(void)
{
    int n, k;
    int s[100];
    int letters[26] = {0};

    scanf("%d %d", &n, &k);
    getchar();
    for(int i = 0; i < n; i++)
    {
        s[i] = getchar();
        letters[s[i] - 'a']++;
    }

    for(int i = 0; i < 26; i++)
        if(letters[i] != 0 && letters[i] < k)
        {
            printf("NO\n");
            return 0;
        }

    printf("YES\n");
}

#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{
    int n,k;
    scanf("%d %d",&n,&k);getchar();
    char s[n+1];
    int i,a[26]={0};
    gets(s);
    for(i=0;i<strlen(s);i++){
        a[s[i]-'a']++;
    }
    int p[1000]={0},j,flag=0;
    for(i=0;i<k;i++){
        for(j=0;j<26;j++){
         if(a[j]!=0){
            p[i]++;a[j]--;
         }
         if(p[i]==2)break;
        }
        if(p[i]<2)flag=1;

    }
    for(i=0;i<k;i++){
        if(p[i]!=2)flag=1;
    }
    if(flag==1)printf("NO");
    else printf("YES");
    return 0;
}

#include <stdio.h>

int N,K;
char baloon[110];
int chart[30];

int sol(){
	int i,j,num=2;
	for(i=0;i<K;i++){
		num=2;
		for(j=0;j<26;j++){
			if(num==0) break;
			if(chart[j]){
				num--;
				chart[j]--;
			}
		}
		if(num!=0) return 0;
	}
	return 1;
}

int main(){

	int i,ans,j;
	scanf("%d %d",&N,&K);

	scanf("%s",baloon);

	for(i=0;i<N;i++){
		chart[baloon[i]-'a']++;
	}
	ans = sol();
	if(ans) printf("YES");
	else printf("NO");

/*
	for(i=0;i<26;i++){
		if(chart[i])
			printf("%c : %d\n",'a'+i,chart[i]);
	}printf("\n");

	sort();

	for(i=0;i<N;i++){
		printf("%c",baloon[i]);
	}printf("\n");
*/
	return 0;
}

#include<stdio.h>

int main(void)
{
	int n, k, cnt, num = 0;
	char tmp_char = '0';
	//printf("Enter the number of n and k\n");
	scanf("%d%d", &n, &k);
	char* ballon = (char*)malloc(sizeof(char)*n);
	//printf("Enter the clolr of ballon\n");
	scanf("%s", ballon);
	printf("\n");
	if (n > 2*k) //풍선이 너무 많음
		printf("No\n"); //ok
	else
	{
		for (int i = 0; i < n; i++)
		{
			tmp_char = ballon[i];
			num = 0;
			for (int j = 0; j < n; j++)
			{
				if (tmp_char == ballon[j])
					num++;
			}
			if (num > k)
			{
				printf("No");
				return 0;
			}
		}
		printf("Yes");
	}
	return 0;
}

/*
1. 입력 받기/
2. 입력 받은 풍선을 array에 넣기/
3. 변수 cnt와 tmp 만들기 /
4. tmp로 색을 비교하면서 해당 색과 같은 색이 몇개 있는지 cnt로 저장
5. ( 풍선수 > 학생수*2 ) -> No/
6. cnt와 학생 수를 비교, ( cnt > 학생수 ) -> No/

*/

#include<stdio.h>
#include<conio.h>
int main()
{
	int n,k,i,j,d,z,c;
  char s[100];
  z=0;
scanf("%d%d",&n,&k);
for(i=0;i<n;i++)
scanf("%c",&s[i]);
for(i=0;i<n;i++)
{ c=0;
	for(j=i+1;j<n;j++)
	{
		if(s[i]==s[j])
		{s[j]=0;
		c++;}
	}
	if(c>=k)
	{ z++;
		printf("NO");
		break;
	}
}if(z==0)
printf("YES");
}

#include<stdio.h>
#include<string.h>
char s[201];
int a[26];
int main()
{
 int n,k;
 scanf("%d%d%s",&n,&k,s);
 for(int i=0;i<n;i++)
 {
  a[s[i]-'a']++;
 }
 for(int i=0;i<26;i++)
 {
   if(a[i]>k)
   return puts("NO"),0;
   puts("YES");
 }
 return 0;
}

#include <stdio.h>
int a[150];
int main()
{
    int i,n,k,flag=1;
    scanf("%d%d",&n,&k);
    char x;
    for(i=0;i<n;i++)
    {
        scanf("%c",&x);
        a[x]++;
        if(a[x]>k)
        {
            flag=0;
            break;
        }
    }
    if(flag)
        printf("YES");
    else
        printf("NO");
    return 0;
}

#include <stdio.h>
#define MAX_CHARS 255 // Maximum characters allowed

int main()
{
    int freq[MAX_CHARS]; // Store frequency of each character
    int i = 0, max;
    int ascii;
    int n,k;
    scanf("%d%d",&n,&k);
    char str[n+1];
    gets(str);

    /* Initializes frequency of all characters to 0 */
    for(i=0; i<MAX_CHARS; i++)
    {
        freq[i] = 0;
    }

    /* Finds frequency of each characters */
    i=0;
    while(str[i] != '\0')
    {
        ascii = (int)str[i];
        freq[ascii] += 1;

        i++;
    }

    /* Finds maximum frequency */
    max = 0;
    for(i=0; i<MAX_CHARS; i++)
    {
        if(freq[i] > freq[max])
            max = i;
    }
    if((freq[max])>k)
    printf("NO");
    else
    printf("YES");
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
int n,k,i,l,j=0,c;
scanf("%d %d",&n,&k);
char s[100];
scanf("%s",&s);
l=strlen(s);
for(i=0;i<l;i++){
        c=1;
 for(j=i+1;j<l;j++){
   if(s[i]==s[j]){
   c++;
   }

 }
 if(c==k){
 printf("YES");
  return 0;
 }
 else
 {
 printf("NO");
 return 0;
 }

}

}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main()
{
  int n,k,i,j,count=0;
  char s[1000];

  scanf("%d %d",&n,&k);
  scanf("%s",s);

  for(i=0;i<strlen(s);i++)
  {
      for(j=i;j<strlen(s)-1;j++)
      {
          if(s[i]==s[j])
          {

            count++;

          }
      }
  }
  if(count%k==0)
  {
      printf("YES");
  }
  else
  {
      printf("NO");
  }
  return 0;

}

#include <stdio.h>

int main()
{
	int b_cnt = 'z' - 'a' + 1;
	int	b_mas[ b_cnt ];
	memset( b_mas, 0, sizeof( b_mas ));
	int n,k,i;
	char sym;
	scanf( "%d %d", &n, &k );
	int ans = 1;
	i=0;
	while ( i < n ) {
		scanf( "%c", &sym );
		if ( sym == ' ' || sym == '\n')
			continue;
		b_mas[sym - 'a']++;
		i++;
	}
	for ( i=0; i < n; i++ ) {
		if ( b_mas[i] > k ) {
			ans = 0;
			break;
		}
	}
	printf("%s\n", ans ? "YES" : "NO");
}

#include<stdio.h>
#include<string.h>
int main()
{
    char s[1001];
    int n,i,j,c,d,k;
    scanf("%d %d",&n,&c);
    scanf("%s",s);
    for (i=0;i<n; i++)
    {
        d=1;
        for (j=1; j<n; j++)
        {
            if (s[i]==s[j])
            {
                d++;

            }
            if (d>c)
            {
                printf("NO");
                return 0;
            }
        }
    }
    printf("YES");
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main()
{
  int n,k,i,j,count=0,max=0;
  char s[1000];
  char tem;
  scanf("%d %d",&n,&k);
  scanf("%s",s);

  for(i=0;i<strlen(s);i++)
  {
      for(j=i+1;j<strlen(s);j++)
      {
          if(s[i]>s[j])
          {
              tem=s[i];
              s[i]=s[j];
              s[j]=tem;
          }
      }

  }

  for(i=0;i<strlen(s);i++)
  {
      for(j=i;j<strlen(s);j++)
      {
          if(s[i]==s[j])
          {

            count++;

          }
          else
            {
                if(count>=max)
                {
                    max=count;
                    count=0;
                }
            }
      }
  }
  if(max>k)
  {
      printf("NO");
  }
  else
  {
      printf("YES");
  }
  return 0;

}

#include<stdio.h>
#include<math.h>
int main()
{
	int  n,k,j,i;
	int  mas[27];
	char s;
	for (i=0;i<=27;i++)
		mas[i]=0;
	scanf("%d %d",&n,&k);
	scanf("%c",&s);
	for (i=1;i<=n;i++)
	{
		scanf("%c",&s);
		mas[s-'a']++;
	}
	for (i=0;i<=27;i++)
		if (mas[i]>k)
		{
			printf("NO");
			return 0;
		}
	printf("YES");
	return 0;
}

#include<stdio.h>
#include<string.h>
main()
{
    int i,j,n,k,cnt=0,p;
    char a[110];
    scanf("%d%d",&n,&k);
    scanf("%s",a);
    for(i=0;i<n-1;i++)
    {
        for(j=i+1;j<n;j++)
        {
            if(a[i]==a[j])
            {
                cnt++;
            }
        }
    }
    p=n-cnt;
    if(p>=k)printf("YES\n");
    else printf("NO\n");
    return 0;
}

#include<stdio.h>
int main()
{
	int n,k;
	scanf("%d %d\n",&n,&k);
	char str[n+1];
	scanf("%s",str);
	int i=0,j=0;
	int arr[26]={0};
	for(i=0;i<n;i++)
	{
	for(j=0;j<26;j++)
	{
		if(str[i]==j+97)
		arr[j]++;
	}
	}
	int count=0;
	for(i=0; i<n; i++)
	{
		if(arr[i]>k)
		count++;
	}
	if(count>=1)
	printf("No");
	else
	printf("Yes");

}

#include<stdio.h>
#include<string.h>
int main()
{
  char s[10000];
  int i,n,k,count[1000];
  scanf("%d%d",&n,&k);
  scanf("%s",s);
  for(i=0;i<n;i++){
    count[s[i]-'a']++;
  }
  for(i=0;i<26;i++){
    if(count[i]==count[i+1]){
  printf("YES");
  break;
    }
  else {
    printf("NO");
    break;
  }
}
return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int fre[256];
    int n,k,i,j,l,m,c;
    scanf("%d %d",&n,&k);
    c=0;
    char str[n+1];
    scanf("%s",str);
    l=strlen(str);
    for(m=0;m<256;m++){
            fre[m]=0;
    }
    for(j=0;j<l;j++){
        fre[str[j]]++;
    }
    for(i=0;i<256;i++){
        if(fre[i]!=0){
            if(fre[i]<=k){
                c++;
            }
        }
    }
    if(c==k)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>
#include<conio.h>
int main()
{
	int n,k,i,j,c;c=0;
	char s[100];
	scanf("%d%d\n",&n,&k);
	scanf("%s",s);
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			if(s[i]!=s[j]&& s[i]!=0)
			{
				c++;
				s[i]=0;s[j]=0;
			}
		}
	}
	if(c==k)
	printf("yes");
	else printf("no");
}

#include<stdio.h>
int main()
{
    int n,k,count=1,count1=1,i,j;
    scanf("%d %d",&n,&k);
    char ch[n+1];
    scanf("%s",ch);
    for(i=0;i<n;i++)
    {
        for(j=i+1;j<n;j++)
        {
            if(ch[i]==ch[j])
            {
                count++;
            }
        }
        if(count>count1)
        {
            count1=count;
            count=1;
        }
    }
    if(count1<=k)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include <stdio.h>

int main() {
	int baloes, amigos, tabela[128] = {0}, i = 0;
	char cor[100];

	scanf("%d %d", &baloes, &amigos);
	scanf("%s", cor);
	while(cor[i] != '\0') {
		tabela[cor[i]]++;
		if(tabela[cor[i] - 97] > 1);
		i++;
	}
	i = 0;
	while(i < 128) {
		if(tabela[i] > 1) {
			amigos--;
			tabela[i] -= 2;
		} else {
			i++;
		}
	}
	if(amigos != 0) printf("NO\n");
	else printf("YES\n");
	return 0;
}
/* 1506562664281 */

#include<stdio.h>
int main(){
char s[1000];
int arr[30] ;

int n ,k ,i ;
for(i = 0; i< 27 ; i++)
  arr[i] = 0;

scanf("%d %d",&n,&k);
getchar();

gets(s);
  for(i = 0; i< n ;i++){
    arr[s[i]-'a']++;
  }

int flag =0, j  , count;
j = k;

while(k--){
    count = 0;
  for(i = 0 ;i<27 ;i++){
    if(arr[i] >0 )
    {
      arr[i]--;
      count++;

    }
  }
if(count!= j ){
 flag  =1;
  break;
}
}
if(flag != 1)
  for(i = 0 ;i< 27 ;i++)
    if(arr[i] != 0){
      flag = 1;
    }

if(flag == 1) printf("NO\n");
else printf("YES\n");

return 0;}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    char b[1000],a[1000];
    int i,j,n,k,c=0;
    scanf("%d %d",&n,&k);
    gets(b);
     gets(a);
     if(n%k==0&&n>=k)
     {
    for(i=0;a[i]!='\0';i++)
    {
        for(j=0;j<i;j++)
        {
            if(a[i]==a[j])
            {
                break;
            }
        }
        if(a[i]==a[j]&&i!=0)
            continue;
        else if(j==i)
        {
            for(;j<n;j++)
            {
                if(a[i]==a[j])
                {
                    c++;
                }
            }
        }
        if(c>k)
        {
            printf("NO");
            break;
        }
    }
    if(i==n&&c<=k)
        printf("YES");
     }
     else
        printf("NO");
    return 0;
}

#include <stdio.h>

int main(){

	int n, k;
	char colors[1000000];
	int letras[26];
	char letra;
	scanf("%d %d", &n, &k);

	scanf("%s", colors);
	int i_colors=0;
	int i_letras=0;
	letra = colors[0];
	while(colors[i_colors]!='\n'){
		letras[colors[i_colors]-97]++;
		i_colors++;
	}
	for (int i = 0; i < 26; ++i)
	{
		if(letras[i]>k){
			printf("NO\n");
			return 0;
		}
	}

	printf("YES\n");
	return 0;
}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main()
{
  int n,k,i,j,count=0,tem,min=0;
  char s[1000];

  scanf("%d %d",&n,&k);
  scanf("%s",s);

  for(i=0;i<strlen(s);i++)
  {
      for(j=i+1;j<strlen(s);j++)
      {
          if(s[i]>s[j])
          {
              tem=s[i];
              s[i]=s[j];
              s[j]=tem;
          }
      }

  }

  for(i=0;i<strlen(s);i++)
  {
      count=0;
      for(j=i;j<strlen(s);j++)
      {
          if(s[i]==s[j])
          {

            count++;

          }
          else
          {
              if(min>count)
              {
                  min=count;

              }
          }
      }
  }
  if(min>k)
  {
      printf("NO");
  }
  else
  {
      printf("YES");
  }
  return 0;

}

#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<math.h>
#define ll long long int

int main()
{
    int n,k,a[26],i,max=0;
    scanf("%d %d",&n,&k);
    for(i=0;i<26;i++)
        a[i]=0;
    for(i=0;i<n;i++)
    {
        char c;
        scanf("%c",&c);
        a[c-'a']++;
    }
    for(i=0;i<26;i++)
    {
        if(a[i]>max)
            max=a[i];
    }
    if(max>k)
        printf("NO\n");
    else
        printf("YES\n");
    return 0;
}

#include<stdio.h>
#include<conio.h>
int main()
{
	int n,k,i,j,d,z,c;
  char s[100];
  z=0;
scanf("%d%d",&n,&k);
for(i=0;i<n;i++)
scanf("%c",&s[i]);
for(i=0;i<n;i++)
{ c=0;
	for(j=i+1;j<n;j++)
	{
		if(s[i]==s[j])
		c++;
	}if(c>=k)
	{ z++;
		printf("NO");
		break;
	}
}if(z==0)
printf("YES");}