import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Prince Raj
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int guest = in.nextInt();
            int guard = in.nextInt();

            String s = in.next();
            char[] door = s.toCharArray();

            int[] last = new int[26];
            int[] begin = new int[26];

            for (int i = 0; i < 26; i++) {
                last[i] = -1;
                begin[i] = -1;
            }

            for (int i = 0; i < guest; i++) {
                last[door[i] - 'A'] = i;
            }
            for (int i = guest - 1; i >= 0; i--) {
                begin[door[i] - 'A'] = i;
            }

            int maxOpenDoor = 0;
            for (int i = 0; i < guest; i++) {
                int openDoor = 0;
                for (int j = 0; j < 26; j++) {
                    if (i >= begin[j] && i <= last[j]) {
                        openDoor++;
                    }
                }
                maxOpenDoor = Math.max(openDoor, maxOpenDoor);
            }
            if (maxOpenDoor > guard) {
                out.print("YES");
            } else {
                out.print("NO");
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.util.*;
import java.io.*;

public class Codeforces834B {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());
		char[] lst = new char[n];
		st = new StringTokenizer(br.readLine());
		String s = st.nextToken();
		for (int i = 0; i < n; i++) {
			lst[i] = s.charAt(i);
		}

		int[] start = new int[26];
		int[] end = new int[26];
		for (int i = 0; i < 26; i++) {
			start[i] = -1;
			end[i] = -1;
		}

		for (int i = 0; i < n; i++) {
			int val = (int) lst[i] - 65;
			if (start[val] < 0) {
				start[val] = i;
			}
			end[val] = i;
		}

		boolean ans = true;

		for (int i = 0; i < n; i++) {
			int num = 0;
			for (int j = 0; j < 26; j++) {
				if ((start[j] <= i) && (end[j] >= i))
					num++;
			}
			if (num > k) {
				ans = false;
			}
		}

		if (ans)
			System.out.println("NO");
		else
			System.out.println("YES");

	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author uweto
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt(), k = in.nextInt();
            String a = in.next().toLowerCase();
            int[] lastIndices = new int[26];
            for (int i = n - 1; i >= 0; i--) {
                if (lastIndices[a.charAt(i) - 'a'] < i) lastIndices[a.charAt(i) - 'a'] = i;
            }
            int[] g = new int[26];
            for (int i = 0; i < n && k >= 0; i++) {
                if (g[a.charAt(i) - 'a'] != 1) {
                    g[a.charAt(i) - 'a'] = 1;
                    if (i != lastIndices[a.charAt(i) - 'a']) k--;
                    else if (k == 0) k--;
                } else if (g[a.charAt(i) - 'a'] == 1 && i == lastIndices[a.charAt(i) - 'a']) {
                    k++;
                    g[a.charAt(i) - 'a'] = 1;
                }
            }
            if (k < 0) out.println("YES");
            else out.println("NO");
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main{
	static Scanner s=new Scanner(System.in);
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static IntStream INS(int n) {return REPS(n).map(i->getInt());}
	static int getInt(){return Integer.parseInt(s.next());}

	public static void main(String[]$){
		int[]first=new int[26];
		int[]last=new int[26];
		Arrays.fill(first,1145141919);
		Arrays.fill(last,-1);

		int n=getInt(),k=getInt();
		char[]in=s.next().toCharArray();

		for(int i=0;i<n;++i) {
			first[in[i]-'A']=Math.min(first[in[i]-'A'],i);
			last [in[i]-'A']=Math.max( last[in[i]-'A'],i);
		}

		int[]ps=new int[n+1];
		for(int i=0;i<26;++i)if(last[i]!=-1){
			++ps[first[i]];
			--ps[last[i]+1];
		}
		Arrays.parallelPrefix(ps,Integer::sum);
		//System.out.println(Arrays.toString(ps));

		System.out.println(
				Arrays.stream(ps).max().getAsInt()
				>k?"YES":"NO"
				);
	}
}

import java.util.Arrays;
import java.util.Scanner;

public class CF_834B {
    private static Entrance[] entrances = new Entrance[26];

    static void add_guest(int entrance, int num_guest) {
        if (entrances[entrance] == null) {
            entrances[entrance] = new Entrance(num_guest);
        }
        else {
            entrances[entrance].lastNumGuest = num_guest;
        }
    }

    public static void main(String argv[]) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] map = new int[n+1];
        int[] result = new int[n+1];

        String test = sc.next();

        for (int i = 0; i < test.length(); i++) {
            add_guest(test.charAt(i) - 65, i);
        }

        for (Entrance entrance : entrances) {
            if (entrance != null) {
                map[entrance.firstNumGuest]++;
                map[entrance.lastNumGuest+1]--;
            }
        }

        //System.out.println(Arrays.toString(map));

        int cnt=0;
        for (int i = 0; i < n+1; i++) {
            cnt += map[i];
            result[i] = cnt;
        }

       //System.out.println(Arrays.toString(result));

        int max = 0;
        for (int i = 0; i < n+1; i++)
            if (result[i] > max)
                max = result[i];

        System.out.println((max > k ? "YES":"NO"));
    }
}

class Entrance {
    int firstNumGuest,lastNumGuest;

    Entrance(int firstNum) {
        firstNumGuest = firstNum;
        lastNumGuest = firstNum;
    }

    String getInfo() {
        return String.format("%d:%d", firstNumGuest, lastNumGuest);
    }

}

//package july17;

/**
 * @author ssaxena36
 *
 *
 */
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class MULDIG {
  public void solve() {
      int n = inpi();
      int k = inpi();
      char str[] = inps().toCharArray();
      int freq[] = new int[26];
      Arrays.fill(freq, -1);
      int opened = 0;
      HashMap<Character, Integer> hash = new HashMap<>();
      for(int i =  n - 1; i >= 0; i--)
      {
          if(!hash.containsKey(str[i]))
              hash.put(str[i], i);
      }
      boolean yes = false;
      for(int i = 0; i < n; i++)
      {
          char c = str[i];
          if(freq[c - 65] == -1) // open new DOOR
          {
              freq[c - 65] = 1;
              opened += 1;
          }
          if(opened > k)
          {
              yes = true;
              break;
          }
          if(hash.get(c) == i) // door Close if this ends now
          {
                  opened -= 1;
          }
      }
      if(yes)
          out.println("YES");
      else out.println("NO");
    }

    public boolean isPrime(long n) {
        return BigInteger.valueOf(n).isProbablePrime(5);
    }

    public void SieveOfEratosthenes(int n) {
        boolean prime[] = new boolean[n + 1];
        Arrays.fill(prime, true);
        for (int p = 2; p * p <= n; p++) {
            if (prime[p] == true) {
                for (int i = p * 2; i <= n; i += p) {
                    prime[i] = false;
                }
            }
        }
        for (int p = 2; p <= n; p++) {
            if (prime[p]) {
                // primes[p] = true;
            }
        }
    }
    //------------> Solution
    InputStream obj;
    PrintWriter out;
    String check = "";

    public static void main(String[] args) throws IOException {
        new MULDIG().main1();
    }

    void main1() throws IOException {
        out = new PrintWriter(System.out);
        obj = check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
        solve();
        out.flush();
        out.close();
    }
    byte inbuffer[] = new byte[1024];
    int lenbuffer = 0, ptrbuffer = 0;

    int readByte() {
        if (lenbuffer == -1) {
            throw new InputMismatchException();
        }
        if (ptrbuffer >= lenbuffer) {
            ptrbuffer = 0;
            try {
                lenbuffer = obj.read(inbuffer);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        if (lenbuffer <= 0) {
            return -1;
        }
        return inbuffer[ptrbuffer++];
    }

    boolean isSpaceChar(int c) {
        return (!(c >= 33 && c <= 126));
    }

    int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b));
        return b;
    }

    String inps() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    int inpi() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    long inpl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    float inpf() {
        return Float.parseFloat(inps());
    }

    double inpd() {
        return Double.parseDouble(inps());
    }

    char inpc() {
        return (char) skip();
    }

    int[] inpia(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = inpi();
        }
        return a;
    }

    long[] inpla(int n) {
        long a[] = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = inpl();
        }
        return a;
    }

    String[] inpsa(int n) {
        String a[] = new String[n];
        for (int i = 0; i < n; i++) {
            a[i] = inps();
        }
        return a;
    }

    double[][] inpdm(int n, int m) {
        double a[][] = new double[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = inpd();
            }
        }
        return a;
    }

    int[][] inpim(int n, int m) {
        int a[][] = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = inpi();
            }
        }
        return a;
    }
}

import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class Ques2 {

    static class Scan {

        private final InputStream inputStream;
        private final byte[] buffer = new byte[1024];
        private int currentChar;
        private int numChars;
        private SpaceCharFilter filter;

        public Scan() {
            inputStream = System.in;
        }

        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();

            if (currentChar >= numChars) {
                currentChar = 0;
                try {
                    numChars = inputStream.read(buffer);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buffer[currentChar++];
        }

        public String nextLine() {
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            String str = "";

            try {
                str = br.readLine();
            }
            catch (IOException e) {
            }
            return str;
        }

        public int nextInt() {
            int ch = read();

            while(isSpaceChar(ch))
                ch = read();

            int sgn = 1;

            if (ch == '-') {
                sgn = -1;
                ch = read();
            }

            int res = 0;
            do {
                if(ch < '0' || ch > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += ch - '0';
                ch = read();
            }
            while (!isSpaceChar(ch));

            return res * sgn;
        }

        public long nextLong() {
            int ch = read();

            while (isSpaceChar(ch))
                ch = read();

            int sgn = 1;

            if (ch == '-') {
                sgn = -1;
                ch = read();
            }

            long res = 0;

            do {
                if (ch < '0' || ch > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += ch - '0';
                ch = read();
            }
            while (!isSpaceChar(ch));

            return res * sgn;
        }

        public double nextDouble() {
            int ch = read();

            while (isSpaceChar(ch))
                ch = read();

            int sgn = 1;
            if (ch == '-') {
                sgn = -1;
                ch = read();
            }

            double res = 0;
            while (!isSpaceChar(ch) && ch != '.') {
                if (ch == 'e' || ch == 'E')
                    return res * Math.pow(10, nextInt());
                if (ch < '0' || ch > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += ch - '0';
                ch = read();
            }
            if (ch == '.') {
                ch = read();
                double m = 1;
                while (!isSpaceChar(ch)) {
                    if (ch == 'e' || ch == 'E')
                        return res * Math.pow(10, nextInt());
                    if (ch < '0' || ch > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (ch - '0') * m;
                    ch = read();
                }
            }

            return res * sgn;
        }

        public String readString() {
            int ch = read();
            while (isSpaceChar(ch))
                ch = read();

            StringBuilder res = new StringBuilder();

            do {
                res.appendCodePoint(ch);
                ch = read();
            }
            while (!isSpaceChar(ch));

            return res.toString();
        }

        public boolean isSpaceChar(int ch) {
            if (filter != null)
                return filter.isSpaceChar(ch);
            return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t' || ch == -1;
        }

        public String next() {
            return readString();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

    static class Print {
        private final BufferedWriter bw;

        public Print() {
            this.bw=new BufferedWriter(new OutputStreamWriter(System.out));
        }

        public void print(Object object)throws IOException {
            bw.append(""+object);
        }

        public void println(Object object)throws IOException {
            print(object);
            bw.append("\n");
        }

        public void close()throws IOException {
            bw.close();
        }
    }

    public static void main(String args[]) throws IOException {
        Scan sc = new Scan();
        Print pr = new Print();

        int n, k, c=0;
        n = sc.nextInt();
        k = sc.nextInt();

        String str = sc.next();
        int arr[][] = new int[26][2];

        for(int i=n-1; i>=0; i--) {
            if (arr[str.charAt(i) - 65][0] == 0)
                arr[str.charAt(i) - 65][0] = i;
        }

        for(int i=0; i<n; i++) {
            if (arr[str.charAt(i) - 65][1] == 0) {
                arr[str.charAt(i) - 65][1] = 1;
                c++;
            }
            if(c>k) {
                pr.println("YES");
                pr.close();
                return;
            }
            if (arr[str.charAt(i) - 65][0] == i) {
                c--;
            }
        }

        pr.println("NO");
        pr.close();

    }

}

import java.util.*;
public class Main {
	static int a,b,c,x[],y[],N=10000005;
	public static void main(String args[]){
		Scanner reader=new Scanner(System.in);
		int a=reader.nextInt();
		int b=reader.nextInt();
		String s=reader.next();
		int x[]=new int[26];
		int y[]=new int[26];
		int sum=0;
		for(int n=0;n<26;n++){
			x[n]=N;
			y[n]=N;
		}
		for(int n=1;n<=a;n++){
			int t=s.charAt(n-1)-'A';
			if(x[t]==N){
				x[t]=n;
				y[t]=n;
				sum++;
			}
			else{
				y[t]=n;
			}
		}
		int k=0;
		int max=0;
		Arrays.sort(x);
		Arrays.sort(y);
		int num=y[0];
		int st=1;
		for(int n=0;n<sum;n++){
			//System.out.print(x[n]+" "+num+" ");
			if(x[n]<num){
				k++;
				max=Math.max(max, k);
			}
			else if(x[n]==num){
				int kkk=k+1;
				max=Math.max(max,kkk);
				if(st<25){
					num=y[st];
					st++;
				}
			}
			else{
				k--;
				num=y[st];
				st++;
			}
			//System.out.println(max+" "+k);
		}
		if(max>b){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}

	}

}

import java.util.*;
public class Main
{
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		String s=sc.next();
		int count[]=new int[27];
		int open[]=new int[27];
		for(int i=0;i<n;i++)
		{
			int x=(int)s.charAt(i);
			count[x-65]++;
		}
		int flag=0;
		for(int i=0;i<n;i++)
		{
			int x=(int)s.charAt(i);
			open[x-65]=1;
			int c=0;
			for(int j=0;j<26;j++)
				if(count[j]>0&&open[j]==1)
					c++;
			count[x-65]--;
			if(c>k)
			{
				flag=1;
				break;
			}
		}
		if(flag==1)
			System.out.println("YES");
		else
			System.out.println("NO");
	}
}

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 *
 * @author zqlg3333
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int n, k, guardsCount = 0;
        String s;
        Scanner sc = new Scanner(System.in);
        Map<Character, Integer> charsCount = new HashMap<>();
        Map<Character, Integer> firstIndex = new HashMap<>();
        n = sc.nextInt();
        k = sc.nextInt();
        s = sc.next();
        char previous = s.charAt(0);

        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (charsCount.containsKey(c)) {
                charsCount.put(c, charsCount.get(c) + 1);
            } else {
                charsCount.put(c, 1);
                firstIndex.put(c, i);
            }
        }
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (firstIndex.get(c) == i) {
                guardsCount++;
                if (guardsCount > k) {
                    System.out.println("YES");
                    return;
                }
            }
            charsCount.put(c, charsCount.get(c) - 1);

            if (charsCount.get(c) == 0) {
                guardsCount--;
            }

        }
        System.out.println("NO");
    }
}

import java.util.Scanner;
/**
 * Wrong answer.
 * */

public class C426B {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int guests = scanner.nextInt();
        int guardsAvailable = scanner.nextInt();

        String doors = scanner.next();
        boolean[] arrived = new boolean[26];
        boolean[] taken = new boolean[guests];
        boolean[] left = new boolean[26];
        boolean[] available = new boolean[guests];
        boolean[] justArrived = new boolean[guests];

        for (int i = 0; i < guests; i++) {
            if (!arrived[doors.charAt(i) - 'A']){
                arrived[doors.charAt(i) - 'A'] = true;
                taken[i] = true;
                justArrived[i] = true;
//                System.out.println(i);
            }
        }

        for (int i = guests - 1; i >= 0; i--) {
            if (!left[doors.charAt(i) - 'A']){
                left[doors.charAt(i) - 'A'] = true;
                available[i] = true;
            }
        }
        boolean unguarded = false;

        for (int i = 0; i < guests; i++) {
//            System.out.println(taken[i]);
            if (available[i] && !taken[i]){
//                System.out.println(i);
                guardsAvailable++;
            }

            if (guardsAvailable <= 0 && !(i == guests - 1) && justArrived[i]){
                unguarded = true;
                break;
            }

            if (taken[i] && !available[i]){
                guardsAvailable--;
//                System.out.println(i);
            }
        }

        if (unguarded) System.out.println("YES");
        else System.out.println("NO");
    }
}

import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        TaskD.InputReader in = new TaskD.InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(5, in, out);
        out.close();
    }

    static class TaskD {
        static final int INF = (int) 1.01e9;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.nextLong();
            int k = in.nextInt();
            String seq = in.next();

            List<Character> guards = new ArrayList<>();
            int[] gates = new int[26];

            for (int i = 0; i < 26; i++) {
                gates[i] = -1;
            }

            //traverse seq
            for(int i = 0; i < n; i++)
            {
                //set end index
                gates[seq.charAt(i) - 'A'] = i;
            }

            //traverse seq
            int guards_left = k;
            for(int i=0; i< seq.length(); i++)
            {
                for(int j = 0; j < gates.length && i > 0; j++)
                {
                    if(gates[j]==i-1)
                    {
                        Character at_gateJ = (char)(j+65);
                        guards.remove(at_gateJ);
                        guards_left++;
                    }

                }

                 char gate = seq.charAt(i);
                 boolean contains = guards.contains(gate);
                 //check if gate already assigned to a guard
                 if(!contains && guards_left > 0)
                 {
                    guards.add(gate);
                    guards_left--;
                 }
                 else if(!contains && guards_left == 0)
                 {
                     out.print("YES");
                     return;
                 }
            }

            out.print("NO");
        }

        static class InputReader {
            public BufferedReader reader;
            public StringTokenizer tokenizer;

            public InputReader(InputStream stream) {
                reader = new BufferedReader(new InputStreamReader(stream), 32768);
                tokenizer = null;
            }

            public String next() {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    try {
                        tokenizer = new StringTokenizer(reader.readLine());
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
                return tokenizer.nextToken();
            }

            public int nextInt() {
                return Integer.parseInt(next());
            }

            public long nextLong() {
                return Long.parseLong(next());
            }

        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author caoash
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BTheFestiveEvening solver = new BTheFestiveEvening();
        solver.solve(1, in, out);
        out.close();
    }

    static class BTheFestiveEvening {
        public void solve(int testNumber, FastScanner br, PrintWriter pw) {
            int n = br.nextInt();
            int k = br.nextInt();
            String s = br.nextString();
            int[] first = new int[26];
            int[] last = new int[26];
            char[] in = new char[s.length()];
            for (int i = 0; i < s.length(); i++) {
                in[i] = s.charAt(i);
            }
            Arrays.fill(first, -1);
            Arrays.fill(last, -1);
            for (int i = 0; i < n; i++) {
                last[in[i] - 'A'] = i;
            }
            for (int i = n - 1; i >= 0; i--) {
                first[in[i] - 'A'] = i;
            }
            for (int i = 0; i < n; i++) {
                int numOpened = 0;
                for (int j = 0; j < 26; j++) {
                    if (first[j] <= i && last[j] >= i) {
                        numOpened++;
                    }
                }
                if (numOpened > k) {
                    pw.println("YES");
                    pw.close();
                    break;
                }
            }
            pw.println("NO");
            pw.close();
        }

    }

    static class FastScanner {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastScanner.SpaceCharFilter filter;

        public FastScanner(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

import java.util.Scanner;

/**
 * Created by texnoman on 30.07.17.
 */
public class Main {
    public static void main(String[] args){
        String line;
        String[] lines;
        String doors;
        char[] symbol;
        int[] symbolfinal;

        Scanner scan=new Scanner(System.in);

        line=scan.nextLine();
        lines= line.split(" ");

        doors=scan.nextLine();
        symbol=doors.toCharArray();
        symbolfinal=new int[symbol.length];

        for(int i=0;i<symbol.length;i++) {
            symbolfinal[i]=Character.getNumericValue(symbol[i])-10;
        }

        String resulttest=schet(Integer.parseInt(lines[0]),Integer.parseInt(lines[1]),symbolfinal);
        System.out.println(resulttest);
    }

    public static String schet(int guestcount, int secourity, int[] door){
        int[] schetrazn= new int[26];
        boolean[] opendoors= new boolean[26];
        int opendoorcount=0;

        for(int i=0;i<26;i++) schetrazn[i]=0;
        for(int i=0;i<26;i++) opendoors[i]=false;
        int numberdoor;
        int opendoorcountmax=0;
        for(int i=0;i<guestcount;i++){
            numberdoor=door[i];
            schetrazn[numberdoor]=i;
        }
        /*
        **Счет
         */

        for(int i=0;i<guestcount;i++){
            numberdoor=door[i];
            if (!opendoors[numberdoor]) {
                opendoorcount++;
                opendoors[numberdoor] = true;
            }
            opendoorcountmax=opendoorcount>opendoorcountmax? opendoorcount:opendoorcountmax;

            if(schetrazn[numberdoor]==i) {
                opendoorcount--;
                opendoors[numberdoor]=false;
            }

        }
        if(opendoorcountmax>secourity) return "YES";
        else return "NO";

        }

    }

import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger;

public class Codechef
{

    public static void main (String[] args) throws java.lang.Exception
    {

      Scanner in=new Scanner(System.in);
    int n=in.nextInt();
    int k=in.nextInt();
    String s=in.next();
    HashSet hs = new HashSet<Integer>();
    int[] a=new int[26];
    for(int i=0;i<s.length();i++)
      a[s.charAt(i)-'A']=i;

    for(int i=0;i<s.length();i++)
    {
      hs.add(s.charAt(i)-'A');
      if(hs.size()>k)
        {
          System.out.println("YES");
          System.exit(0);
        }
      if(a[s.charAt(i)-'A']==i)
      hs.remove(s.charAt(i)-'A');

    }
      System.out.println("NO");

}

}

import java.util.HashSet;
import java.util.Scanner;

public class Thefestuveevning {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);
		HashSet<Character> set = new HashSet<Character>();
		int n = input.nextInt();
		int a = input.nextInt();
		String s = input.next();
		int[] arr = new int[n];
		int[] brr = new int[n];
		for(int i=0; i<n;i++){
			if(!set.contains(s.charAt(i))){
				set.add(s.charAt(i));

				for(int j=i; j<n;j++)arr[j]++;
			}
		}
		for(int i=n-1;i>=0;i--){
			if(set.contains(s.charAt(i))){
				set.remove(s.charAt(i));
				for(int j=i+1; j<n;j++)arr[j]--;
			}
		}
		//for(int i=0; i<n;i++)System.out.print(arr[i] + " ");
		//System.out.println(set.size());
		for(int i=0; i<n;i++){
			if(arr[i]>a){
				System.out.println("YES");
				return;
			}
		}
		System.out.println("NO");

	}

}

import java.util.Arrays;
import java.util.Scanner;

public class B426 {
    public static void main(String[] args){
        Scanner sc  = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String s = sc.next();

        int numOfEns[] = new int[n];
        int minEns[] = new int[26];
        int maxEns[] = new int[26];

        Arrays.fill(minEns, (int)1e9);
        for(int i = 0; i < n; i++){
            int value = (int) s.charAt(i) - 65;
            minEns[value] = Math.min(minEns[value], i);
            maxEns[value] = Math.max(maxEns[value], i);
        }

        for(int i = 0; i < n; i++){
            for(int j = 0; j < 26; j++){
                if(minEns[j] != (int)1e9) {
                    if ((minEns[j] <= i) && (i <= maxEns[j]))
                        numOfEns[i]++;
                }
            }
            if(numOfEns[i] > k){
                System.out.println("YES");
                break;
            }
            if(i == n -1)
                System.out.println("NO");
        }
    }
}

import java.io.BufferedInputStream;
import java.util.HashMap;
import java.util.Scanner;

public class B834 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(new BufferedInputStream(System.in));
		int n = scan.nextInt();
		int k = scan.nextInt();
		String s = scan.next();
		HashMap<Character, Integer> lastIndex = new HashMap<Character, Integer>();
		HashMap<Character, Integer> firstIndex = new HashMap<Character, Integer>();
		for (int i=n-1; i>=0; i--) {
			char c = s.charAt(i);
			if (lastIndex.get(c) == null) {
				lastIndex.put(c, i);
			}
		}

		int opened = 0;

		for (int i=0; i<n; i++) {
			char c = s.charAt(i);
			if (firstIndex.get(c) == null) {
				firstIndex.put(c, i);
				opened ++;
				if (opened > k) {
					System.out.println("YES");
					return;
				}
			}

			if (lastIndex.get(c) == i) {
				opened --;
			}
		}

		System.out.println("NO");
	}

}

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n  =scanner.nextInt();
		int m =scanner.nextInt();
		String string = scanner.next();
		char arr[] = string.toCharArray();
		Map<Character, Integer> map = new HashMap<>();
		Set<Character> set = new HashSet<>();
		for(int i =0;i<arr.length;i++) {
			map.put(arr[i], i);
		}
		int used= 0;
		for(int i =0;i<arr.length;i++) {
			if (set.contains(arr[i])) {

			}else {
				used++;
				set.add(arr[i]);
				if (used>m) {
					System.out.println("YES");
					return;
				}
			}
			if (map.get(arr[i])==i) {
				used -- ;
			}
		}
		System.out.println("NO");
								}
}

import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(in, out);
        out.close();
    }
    static class Solver {
        public void solve(InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            String s = in.next();
            Map<Character, Integer> last = new HashMap<>();
            for (int i = 0; i < n; ++i) {
                last.put(s.charAt(i), i);
            }
            Set<Character> active = new HashSet<>();
            for (int i = 0; i < s.length(); ++i) {
                active.add(s.charAt(i));
                if (active.size() > k) {
                    out.println("YES");
                    return;
                }
                if (i == last.get(s.charAt(i))) {
                    active.remove(s.charAt(i));
                }
            }
            out.println("NO");
        }
    }
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }
        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreElements()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    private static String getPartyStatus(char[] guests, Map<Character, Integer> map, int guardCount) {
        int availableGuards = guardCount;
        Map<Character, Integer> enteredGuests = new HashMap<>(26);
        Integer cnt = 0;
        for (char enteringGuest : guests) {
            cnt = enteredGuests.get(enteringGuest);
            if (cnt == null) {
                --availableGuards;
                cnt = 0;
            }
            enteredGuests.put(enteringGuest, ++cnt);
            if (availableGuards < 0) {
                return "YES";
            }
            if (enteredGuests.get(enteringGuest).equals(map.get(enteringGuest))) {
                ++availableGuards;
            }
        }
        return "NO";
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int guestCount = scanner.nextInt();
        int guardCount = scanner.nextInt();
        Map<Character, Integer> map = new HashMap<>(26);
        String guestSequence = scanner.next();
        Integer curCharCount = 0;
        for (char i : guestSequence.toCharArray()) {
            curCharCount = map.get(i);
            if (curCharCount != null) {
                map.put(i, curCharCount + 1);
            } else {
                map.put(i, 1);
            }
        }
        System.out.println(getPartyStatus(guestSequence.toCharArray(), map, guardCount));
        scanner.close();
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.AbstractMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.AbstractMap.SimpleEntry;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String[] split = in.nextLine().split(" ");
            int guards = Integer.parseInt(split[1]);
            String entrances = in.nextLine();

            HashSet<Character> doors = new HashSet<>();
            for (int i = 0; i < entrances.length(); i++) {
                doors.add(entrances.charAt(i));
            }

            HashSet<Map.Entry<Integer, Integer>> pairs = new HashSet<>();
            for (Character door : doors) {
                int start = entrances.indexOf(door);
                int end = entrances.lastIndexOf(door);
                pairs.add(new AbstractMap.SimpleEntry<>(start, end));
            }

            int maxGuards = 0;

            for (int i = 0; i < entrances.length(); i++) {
                int neededGuards = 0;
                for (Map.Entry<Integer, Integer> date : pairs) {
                    if (i >= date.getKey() && i <= date.getValue()) {
                        neededGuards++;
                    }
                }
                maxGuards = Math.max(neededGuards, maxGuards);
            }

            if (maxGuards > guards) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Prince Raj
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int guest = in.nextInt();
            int guard = in.nextInt();

            String s = in.next();
            char[] door = s.toCharArray();

            int[] last = new int[26];
            int[] begin = new int[26];

            for (int i = 0; i < 26; i++) {
                last[i] = -1;
                begin[i] = -1;
            }

            for (int i = 0; i < guest; i++) {
                last[door[i] - 'A'] = i;
            }
            for (int i = guest - 1; i >= 0; i--) {
                begin[door[i] - 'A'] = i;
            }

            int maxOpenDoor = 0;
            for (int i = 0; i < guest; i++) {
                int openDoor = 0;
                for (int j = 0; j < 26; j++) {
                    if (i >= begin[j] && i <= last[j]) {
                        openDoor++;
                    }
                }
                maxOpenDoor = Math.max(openDoor, maxOpenDoor);
            }
            if (maxOpenDoor > guard) {
                out.print("YES");
            } else {
                out.print("NO");
            }
        }

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;

public class ProblemB {

	static Scanner sc = new Scanner(System.in);
	static PrintWriter pw = new PrintWriter(System.out);

	public static void main(String[] args) throws IOException {
		int n = sc.nextInt(), k = sc.nextInt();
		String s = sc.next();
		int[] end = new int[26];
		for (int i = 0; i < n; i++) {
			int curr = s.charAt(i) - 'A';
			end[curr] = i;
		}
//		System.out.println(Arrays.toString(end));
		int needed = 1;
		HashSet<Integer> set = new HashSet<>();
		for (int i = 0; i < n; i++) {
			int curr = s.charAt(i) - 'A';
			set.add(curr);
			needed = Math.max(needed, set.size());
			if (end[curr] == i) {
				set.remove(curr);
			}
		}
//		System.out.println(needed);
		if (needed <= k) {
			System.out.println("NO");
		} else
			System.out.println("YES");
		pw.flush();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] array = new int[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextInt();
			}
			return array;
		}
	}
}

import java.awt.List;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class CodeChef {
	public static void main(String[] args) throws FileNotFoundException  {
        Scanner sc=new Scanner(System.in);
	    int n=sc.nextInt(),k=sc.nextInt();
	    String s=sc.next();
	    int[] tot=new int[26],tnow=new int[26];
	    for(int i=0;i<s.length();i++)
	    	tot[s.charAt(i)-65]++;
	    int count=1;
	    tnow[s.charAt(0)-65]++;
	    if(k<count){
	    	System.out.println("YES");
	    	System.exit(0);
	    }
	    for(int i=1;i<s.length();i++){
	    	tnow[s.charAt(i)-65]++;
	    	if(s.charAt(i)!=s.charAt(i-1)){
	    		//System.out.println("xD");
	    		if(tot[s.charAt(i-1)-65]==tnow[s.charAt(i-1)-65])
		    		 count--;
	    		if(tnow[s.charAt(i)-65]==1){
	    			count++;
    		    //	System.out.println(k+" HEy "+count+" "+s.charAt(i));
	    			if(k<count){
	    		    	//System.out.println(k+" HEy "+count);
	    				System.out.println("YES");
	    		    	System.exit(0);
	    		    }
	    		}

	    	}

	    }
	    System.out.println("NO");
	}
}

import java.util.*;
import java.lang.*;
import java.io.*;

public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String s=br.readLine();
        StringTokenizer st=new StringTokenizer(s);
        int n=Integer.parseInt(st.nextToken());
        int k=Integer.parseInt(st.nextToken());
        int[] start=new int[26];
        for(int i=0;i<26;i++){
            start[i]=Integer.MAX_VALUE;
        }
        int[] end=new int[26];
        for(int i=0;i<26;i++){
            end[i]=Integer.MIN_VALUE;
        }
        String str=br.readLine();
        for(int i=0;i<n;i++){
            int t=(int)str.charAt(i)-65;
            if(start[t]>i)
                start[t]=i;
            if(end[t]<i)
                end[t]=i;
        }
        int[] time=new int[n];
        for(int i=0;i<26;i++){
            if(start[i]==Integer.MAX_VALUE){
                continue;
            }
            else{
                //System.out.println(i+" "+start[i]+" "+end[i]);
                for(int j=start[i];j<=end[i];j++){
                    time[j]++;
                }

            }
        }
        Arrays.sort(time);
        int req=(time[n-1]);
        if(k>=req){
            System.out.println("NO");
        }
        else
            System.out.println("YES");
    }

}

import java.io.BufferedReader;
	import java.io.IOException;
	import java.io.InputStreamReader;
	import java.io.PrintWriter;
import java.util.Map.Entry;
import java.util.*;

	   public class Main {

		/*public static int ispr(int n)
	    	{
	    	//boolean[] isPrime = new boolean[n+1];
	        for (int i = 2; i <= n; i++) {
	            Prime[i] = true;
	        }

	        // mark non-primes <= n using Sieve of Eratosthenes
	        for (int factor = 2; factor*factor <= n; factor++) {

	            // if factor is prime, then mark multiples of factor as nonprime
	            // suffices to consider mutiples factor, factor+1, ...,  n/factor
	            if (Prime[factor]) {
	                for (int j = factor; factor*j <= n; j++) {
	                    Prime[factor*j] = false;
	                }
	            }
	        }
	        // count primes

	        /*int primes = 0;
	        for (int i = 2; i <= n; i++) {
	            if (isPrime	[i])System.out.println(i);

	        }*/
		// System.out.println("The number of primes <= " + n + " is " + primes);
		//return 0;
		// if(isPrime[n]==true)return 1; else return 0;

		//}

		public static long fact(long x)
		{
			if(x==0)return 1;
			else return x*fact(x-1);
		}

		public static long exp(long x, long n, long M)
		{

			if(n==0) return 1;

			else if(n%2==0) return exp((x*x)%M,n/2,M);
			else return (x*exp((x*x)%M,(n-1)/2,M))%M;

		}

		//fi

		static long fib(long n)
		{
			long F[][] = new long[][]{{1,1},{1,0}};
			if (n == 0)
				return 0;
			power(F, n-1);

			return F[0][0];
		}

		static int mod=1000000007;

		static void multiply(long F[][], long M[][])
		{
			long x =  (((F[0][0]%mod)*(M[0][0]%mod))%mod + ((F[0][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long y =  (((F[0][0]%mod)*(M[0][1]%mod))%mod + ((F[0][1]%mod)*(M[1][1]%mod))%mod)%mod;
			long z =  (((F[1][0]%mod)*(M[0][0]%mod))%mod + ((F[1][1]%mod)*(M[1][0]%mod))%mod)%mod;
			long w =  (((F[1][0]%mod)*(M[0][1]%mod))%mod + ((F[1][1]%mod)*(M[1][1]%mod))%mod)%mod;

			F[0][0] = x;
			F[0][1] = y;
			F[1][0] = z;
			F[1][1] = w;
		}

		/* Optimized version of power() in method 4 */
		static void power(long F[][], long n)
		{
			if( n == 0 || n == 1)
				return;
			long M[][] = new long[][]{{1,1},{1,0}};

			power(F, n/2);
			multiply(F, F);

			if (n%2 != 0)
				multiply(F, M);
		}

		public static int gcd(int a, int b)
		{
			if(b==0)
				return a;
			else return gcd(b,a%b);
		}

		static  class MyScanner {

			BufferedReader br;
			StringTokenizer st;

			public MyScanner() {
				br = new BufferedReader(new InputStreamReader(System.in));
			}

			String next() {
				while (st == null || !st.hasMoreElements()) {
					try {
						st = new StringTokenizer(br.readLine());
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
				return st.nextToken();
			}

			int nextInt() {
				return Integer.parseInt(next());
			}

			long nextLong() {
				return Long.parseLong(next());
			}

			double nextDouble() {
				return Double.parseDouble(next());
			}

			String nextLine(){
				String str = "";
				try {
					str = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				return str;
			}

		}

		static MyScanner sc = new  MyScanner();
		static PrintWriter pw = new PrintWriter(System.out, true);

		static void printPath(int parent[], int j)
		{
		    // Base Case : If j is source
		    if (parent[j]==-1)
		        {pw.print(j+" ");return;}

		    printPath(parent, parent[j]);

		    pw.print(j+" ");
		}

		//Main begins here :)

		public static class Pair{
		    int a;
		    int b;
		    Pair(int p,int q){
		        a=p;
		        b=q;
		    }
		    public boolean equals(Object o) {
		        if (o instanceof Pair) {
		            Pair p = (Pair)o;
		            return p.a == a && p.b == b;
		        }
		        return false;
		    }
		    public int hashCode() {
		        return new Integer(a).hashCode() * 31 + new Integer(b).hashCode();
		    }
		}

		public static int max1(String st, int k)
		{
			int n1=0;
			int max=Integer.MIN_VALUE;
			int n = st.length();
			if(n==1)
			{
				if(st.charAt(0)=='1')return 1;
				else return 0;
			}

			for(int i=1;i<=k;i++)
			{
				int chp=i-1;

				if(st.charAt(chp)=='1')n1++;

			}
			max=Math.max(max, n1);
		//	if(k>=n)return max;
			int slides=n-k;
			int ptr1=0, ptr2=k-1;

			for(int i=1;i<=slides;i++)
			{
				//pw.println(st.substring(ptr1+i, ptr2+i+1));
				ptr1++; ptr2++;
				if(st.charAt(ptr1-1)=='1')n1--;
				if(st.charAt(ptr2)=='1')n1++;
				//pw.println("m1- "+n1);
				if(n1>max)max=n1;
				if(max==k){return k;}
			}

			return max;

		}

		public static String shift(String A)
		{
			char lc = A.charAt(A.length()-1);
			return lc+A.substring(0,A.length()-1);

		}

		static class Point
		{
			long x,y;

			public Point(long a, long b)
			{
				x=a;
				y=b;
			}

		}

		static class compx implements Comparator<Point>
		{
			public int compare(Point a, Point b)
			{

				if(a.x>b.x)return 1;
				if(a.x<b.x) return -1;

				return 0;
			}
		}

		public static int value(String st,int si,int k, int mpos)
		{

		     if(k>=st.length())return mpos;
		     int max=0;
		     int long1=0;
		     int len = st.length();
		     for(int i=0;i<len;i++)
		     {
		          int ri = (si+i)%len;
		          if(st.charAt(ri)=='0')long1=0;
		          else
		          {
		               long1++;
		               if(long1>max)max=long1;
		               if(max==k)return k;
		          }

		     }
		     return max;

		}

			public static long ret(long x)
			{
				if(x==0)return 1;
				if(x==1)return 2;

				return 2+(((x+2)*(x-1))/2);

			}

			static class Myset
			{
				int size;
				int[] arr;
				int noe;

				Myset(int n)
				{
					size=n;
					arr= new int[n];
					Arrays.fill(arr, -1);
					noe =0;

				}

				void add(int el)
				{
					if(arr[el]==-1)
					{
						arr[el]=1;
						noe++;
					}

				}

			}

		public static void main(String[] args) {

				int n = sc.nextInt();
				int k = sc.nextInt();

				String s = sc.nextLine();
				//int no[] = new int[n];
				int nor=0;
				int[] alpha = new int[26];
				int last[] = new int[26];
				Arrays.fill(last, -1);
				Arrays.fill(alpha, -1);
				int maxi = Integer.MIN_VALUE;

				for(int i=n-1;i>=0;i--)
				{
					char cc = s.charAt(i);
					if(last[cc-65]==-1)last[cc-65]=i;

				}
				/*
				 *
				 *
				 *
				 * */
				for(int i=0;i<n;i++)
				{
					char cc = s.charAt(i);
					if(alpha[cc-65]==-1||i==last[cc-65])
					{
						if(alpha[cc-65]==-1)
						{
							nor++;
							alpha[cc-65]=1;
							maxi = Math.max(maxi, nor);
							if(last[cc-65]==i)nor--;

						}
						else
						{
							nor--;
							alpha[cc-65]=2;
							maxi = Math.max(maxi, nor);

						}

					}

				}
				String A = (maxi>k)?"YES":"NO";

				//pw.println(maxi+" "+nor);
				pw.println(A);

			pw.close();
			/*int t =sc.nextInt();
			while(t-->0)
			{
				int x = sc.nextInt();
				long k =sc.nextLong();
				String st = sc.nextLine();
				long na=0,nb=0;
				for(int i=0;i<x;i++)
				{
					if(st.charAt(i)=='a')na++;
					if(st.charAt(i)=='b')nb++;

				}
				long bs[] = new long[x];
				bs[x-1]=(st.charAt(x-1)=='b')?1:0;

				for(int i=x-2;i>=0;i--)
				{
					bs[i]=(st.charAt(i)=='b')?(bs[i+1]+1):bs[i+1];
				}
				int c=0;

				for(int i=0;i<x;i++)
				{
					if(st.charAt(i)=='a')
					{
						c+=bs[i];

					}

				}
				long k2 = k-1;
				long ans = ((long)k2*(k2+1))/2;
				ans = ans*na*nb;
				ans += (c*k);

				pw.println(ans);

			}
		*/

		}

		}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {

	static Scanner in = new Scanner(System.in);

	public static void main(String[] args) throws IOException {
		// BufferedReader br = new BufferedReader(new
		// InputStreamReader(System.in));
		// StringTokenizer st = new StringTokenizer(br.readLine());
		int n = in.nextInt();
		int k = in.nextInt();
		String str = in.next();
		int lastId[] = new int[26];
		boolean used[] = new boolean[26];
		Arrays.fill(lastId, -1);
		Arrays.fill(used, false);

		for (int i = 0; i < n; i++) {
			lastId[str.charAt(i) - 'A'] = i;
		}
		//System.out.println(Arrays.toString(lastId));
		boolean ok = true;

		for (int i = 0; i < n; i++) {
			char c = str.charAt(i);
			if (!used[c - 'A']) {
				used[c - 'A'] = true;
				k--;
			}

			if(k<0){
				ok = false;
				break;
			}

			if (lastId[c - 'A'] == i)
				k++;

		}
		if(!ok)
			System.out.println("YES");
		else {
			System.out.println("NO");
		}
	}

}

import java.awt.geom.Point2D;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;

public class Main {
  final static int INF = 1 << 28;
  final static long LNF = 1L << 60;
  final static long MOD = 1_000_000_007;
  final static double EPS = 1e-9;
  final static double GOLDEN_RATIO = (1.0 + Math.sqrt(5)) / 2.0;
  Scanner sc = new Scanner(System.in);

  public static void main(String[] args) {
    new Main().run();
  }

  void run() {
    int[] left = new int[256];
    int[] right = new int[256];
    for (int i = 'A'; i <= 'Z'; ++i) {
      left[i] = right[i] = -1;
    }
    int n = ni();
    int k = ni();
    String str = sc.next();
    for (int i = 0; i < n; ++i) {
      char c = str.charAt(i);
      if (left[c] == -1) {
        left[c] = i;
        right[c] = i;
      } else {
        right[c] = i;
      }
    }
    int[] imos = new int[2000000];
    for (int i = 'A'; i <= 'Z'; ++i) {
      if (left[i] == -1) {
        continue;
      }
      imos[left[i]]++;
      imos[right[i] + 1]--;
    }
    int max = 0;
    int acc = 0;
    for (int i = 0; i < 2000000; ++i) {
      acc += imos[i];
      max = Math.max(max, acc);
    }
    if (max > k) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  }

  int ni() {
    return Integer.parseInt(sc.next());
  }

  long nl() {
    return sc.nextLong();
  }

  double nd() {
    return Double.parseDouble(sc.next());
  }

  void debug(Object... os) {
    System.err.println(Arrays.deepToString(os));
  }

  /**
   * ユークリッドの互除法
   *
   * @return a と b の最大公約数
   */
  long gcd(long a, long b) {
    if (b == 0) {
      return a;
    }
    return gcd(b, a % b);
  }

  /**
   * 拡張ユークリッドの互除法
   *
   * @return mx + ny = gcd(m, n)となるような(x, y)を返す
   */
  Pair<Long, Long> gcd_ex(long m, long n) {
    long[][] mat = _gcd_ex(m, n);
    return new Pair<>(mat[0][0], mat[0][1]);
  }

  long[][] _gcd_ex(long m, long n) {
    if (n == 0) {
      return new long[][]{{1, 0}, {0, 1}};
    }
    long k = m / n;
    long[][] K = new long[][]{{0, 1}, {1, -k}};
    long[][] r = _gcd_ex(n, m % n);
    long[][] dst = new long[2][2];
    for (int y = 0; y < 2; ++y)
      for (int x = 0; x < 2; ++x)
        for (int i = 0; i < 2; ++i)
          dst[y][x] += r[y][i] * K[i][x];
    return dst;
  }

  /**
   * 繰り返し2乗法を用いたべき乗の実装
   *
   * @return a^r (mod 1,000,000,007)
   */
  long pow(long a, long r) {
    long sum = 1;
    while (r > 0) {
      if ((r & 1) == 1) {
        sum *= a;
        sum %= MOD;
      }
      a *= a;
      a %= MOD;
      r >>= 1;
    }
    return sum;
  }

  /**
   * 組み合わせ
   * O(n)
   *
   * @return {}_nC_r
   */
  long C(int n, int r) {
    long sum = 1;
    for (int i = n; 0 < i; --i) {
      sum *= i;
      sum %= MOD;
    }
    long s = 1;
    for (int i = r; 0 < i; --i) {
      s *= i;
      s %= MOD;
    }
    sum *= pow(s, MOD - 2);
    sum %= MOD;

    long t = 1;
    for (int i = n - r; 0 < i; --i) {
      t *= i;
      t %= MOD;
    }
    sum *= pow(t, MOD - 2);
    sum %= MOD;

    return sum;
  }

  /**
   * 黄金分割探索
   *
   * @param left  下限
   * @param right 上限
   * @param f     探索する関数
   * @param comp  上に凸な関数を探索するときは、Comparator.comparingDouble(Double::doubleValue)
   *              下に凸な関数を探索するときは、Comparator.comparingDouble(Double::doubleValue).reversed()
   * @return 極値の座標x
   */
  double goldenSectionSearch(double left, double right, Function<Double, Double> f, Comparator<Double> comp) {
    double c1 = divideInternally(left, right, 1, GOLDEN_RATIO);
    double c2 = divideInternally(left, right, GOLDEN_RATIO, 1);
    double d1 = f.apply(c1);
    double d2 = f.apply(c2);
    while (right - left > 1e-9) {
      if (comp.compare(d1, d2) > 0) {
        right = c2;
        c2 = c1;
        d2 = d1;
        c1 = divideInternally(left, right, 1, GOLDEN_RATIO);
        d1 = f.apply(c1);
      } else {
        left = c1;
        c1 = c2;
        d1 = d2;
        c2 = divideInternally(left, right, GOLDEN_RATIO, 1);
        d2 = f.apply(c2);
      }
    }
    return right;
  }

  /**
   * [a,b]をm:nに内分する点を返す
   */
  double divideInternally(double a, double b, double m, double n) {
    return (n * a + m * b) / (m + n);
  }

  /**
   * http://alexbowe.com/popcount-permutations/
   * bitの立っている数が小さい順にループしたいときに使う。
   * ex)
   * <pre>
   * for (int i = 0; i < 25; ++i) {
   *   int bits = (1 << i) - 1;
   *   long m = C(25, num);
   *   for (j = 0; j < m; ++j) {
   *     ...(25個の中からi個bitが立っている)
   *     if (bits != 0)
   *       bits = next_perm(bits);
   *   }
   * }
   * </pre>
   *
   * @param v 現在のbit列
   * @return 次のbit列
   */
  int next_perm(int v) {
    int t = (v | (v - 1)) + 1;
    return t | ((((t & -t) / (v & -v)) >> 1) - 1);
  }

  static class Util {
    static <T extends Comparable<T>> T max(T a, T b) {
      if (a.compareTo(b) > 0) {
        return a;
      } else {
        return b;
      }
    }

    static <T extends Comparable<T>> T min(T a, T b) {
      if (a.compareTo(b) < 0) {
        return a;
      } else {
        return b;
      }
    }
  }

  /**
   * from http://gihyo.jp/dev/serial/01/geometry part 6
   */
  static class Line {
    double a;
    double b;
    double c;

    /**
     * 一般形のパラメータから直線を作成する
     *
     * @param a xの係数
     * @param b yの係数
     * @param c 定数項
     */
    Line(double a, double b, double c) {
      this.a = a;
      this.b = b;
      this.c = c;
    }

    /**
     * 2点(x1, y1), (x2, y2)を通る直線を作成する
     *
     * @param x1 1点目のx座標
     * @param y1 1点目のy座標
     * @param x2 2点目のx座標
     * @param y2 2点目のy座標
     * @return 直線
     */
    static Line fromPoints(double x1, double y1, double x2, double y2) {
      double dx = x2 - x1;
      double dy = y2 - y1;
      return new Line(dy, -dx, dx * y1 - dy * x1);
    }

    /**
     * 与えられた直線との交点を返す
     *
     * @param l 直線
     * @return 交点。2直線が平行の場合はnull
     */
    Point2D getIntersectionPoint(Line l) {
      double d = a * l.b - l.a * b;
      if (d == 0.0) {
        return null;
      }
      double x = (b * l.c - l.b * c) / d;
      double y = (l.a * c - a * l.c) / d;
      return new Point2D.Double(x, y);
    }

    @Override
    public String toString() {
      return "a = " + a + ", b = " + b + ", c = " + c;
    }
  }

  static class Line1D {
    int x1;
    int x2;

    // [x1, x2) : 半開空間
    Line1D(int x1, int x2) {
      this.x1 = x1;
      this.x2 = x2;
    }

    boolean isCross(Line1D l) {
      return isCross(l.x1, l.x2);
    }

    boolean isCross(int y1, int y2) {
//      boolean ret = x1 < y2 && y1 < x2;
//      assert ret == new LineSegment(x1, 0, x2, 0).intersects(new LineSegment(y1, 0, y2, 0));
//      return ret;
      return new LineSegment(x1 - 0.25, 0, x2 + 0.25, 0).intersects(new LineSegment(y1 - 0.25, 0, y2 + 0.25, 0));
    }
  }

  /**
   * from http://gihyo.jp/dev/serial/01/geometry part 6
   */
  static public class LineSegment {
    double x1;
    double y1;
    double x2;
    double y2;

    LineSegment(double x1, double y1, double x2, double y2) {
      this.x1 = x1;
      this.y1 = y1;
      this.x2 = x2;
      this.y2 = y2;
    }

    Line toLine() {
      return Line.fromPoints(x1, y1, x2, y2);
    }

    boolean intersects(Line l) {
      double t1 = l.a * x1 + l.b * y1 + l.c;
      double t2 = l.a * x2 + l.b * y2 + l.c;
      return t1 * t2 <= 0;
    }

    boolean intersects(LineSegment s) {
      return bothSides(s) && s.bothSides(this);
    }

    // sが自線分の「両側」にあるかどうかを調べる
    private boolean bothSides(LineSegment s) {
      double ccw1 = GeomUtils.ccw(x1, y1, s.x1, s.y1, x2, y2);
      double ccw2 = GeomUtils.ccw(x1, y1, s.x2, s.y2, x2, y2);
      if (ccw1 == 0 && ccw2 == 0) { // sと自線分が一直線上にある場合
        // sのいずれか1つの端点が自線分を内分していれば、sは自線分と共有部分を持つので
        // trueを返す
        return internal(s.x1, s.y1) || internal(s.x2, s.y2);
      } else { // それ以外の場合
        // CCW値の符号が異なる場合にtrueを返す
        return ccw1 * ccw2 <= 0;
      }
    }

    // (x, y)が自線分を内分しているかどうかを調べる
    private boolean internal(double x, double y) {
      // (x, y)から端点に向かうベクトルの内積がゼロ以下であれば内分と見なす
      return GeomUtils.dot(x1 - x, y1 - y, x2 - x, y2 - y) <= 0;
    }

    public Point2D getIntersectionPoint(Line l) {
      if (!intersects(l)) {
        return null; // 交差しない場合はnullを返す
      }
      return l.getIntersectionPoint(toLine());
    }

    public Point2D getIntersectionPoint(LineSegment s) {
      if (!intersects(s)) {
        return null; // 交差しない場合はnullを返す
      }
      return s.toLine().getIntersectionPoint(toLine());
    }

    /**
     * from : http://www.deqnotes.net/acmicpc/2d_geometry/lines#distance_between_line_segment_and_point
     */
    double distance(double x0, double y0) {
      // 端点チェック
      if (GeomUtils.dot(x2 - x1, y2 - y1, x0 - x1, y0 - y1) < EPS) {
        return GeomUtils.abs(x0 - x1, y0 - y1);
      }
      if (GeomUtils.dot(x1 - x2, y1 - y2, x0 - x2, y0 - y2) < EPS) {
        return GeomUtils.abs(x0 - x2, y0 - y2);
      }
      // 直線と点の距離
      return Math.abs(GeomUtils.cross(x2 - x1, y2 - y1, x0 - x1, y0 - y1)) / GeomUtils.abs(x2 - x1, y2 - y1);
    }

    double distance(LineSegment l) {
      if (this.intersects(l)) {
        return 0.0;
      }
      double min = Double.MAX_VALUE;
      min = Math.min(min, distance(l.x1, l.y1));
      min = Math.min(min, distance(l.x2, l.y2));
      min = Math.min(min, l.distance(x1, y1));
      min = Math.min(min, l.distance(x2, y2));
      return min;
    }

    @Override
    public String toString() {
      return "(" + x1 + ", " + y1 + ") - (" + x2 + ", " + y2 + ")";
    }
  }

  /**
   * from http://gihyo.jp/dev/serial/01/geometry part 6
   */
  static class GeomUtils {
    // 外積
    static double cross(double x1, double y1, double x2, double y2) {
      return x1 * y2 - x2 * y1;
    }

    // 内積
    static double dot(double x1, double y1, double x2, double y2) {
      return x1 * x2 + y1 * y2;
    }

    // (x1, y1) -> (x2, y2) -> (x3, y3) と進む道のりが半時計回りの場合は正の値、
    // 時計回りの場合は負の値、一直線上の場合はゼロを返す
    static double ccw(double x1, double y1, double x2, double y2,
                      double x3, double y3) {
      return cross(x2 - x1, y2 - y1, x3 - x2, y3 - y2);
    }

    static double ccw(Point2D p1, Point2D p2, Point2D p3) {
      return ccw(p1.getX(), p1.getY(), p2.getX(), p2.getY(), p3.getX(), p3.getY());
    }

    // ベクトルの長さ
    static double abs(double x, double y) {
      return Math.sqrt(x * x + y * y);
    }

    // 多角形の内外判定
    // http://www.nttpc.co.jp/technology/number_algorithm.html
    // 模擬国内2017EでWAになった
    // 凸多角形 -> 右周りでccwが全部負
    // 凹多角形含む単純な多角形 -> 点から無限に右に伸ばした線分との交点が1つ
    static boolean isIn(ArrayList<LineSegment> list, double x, double y) {
      int wn = 0;
      for (LineSegment l : list) {
        if (l.y1 <= y && l.y2 > y) {
          double vt = (y - l.y1) / (l.y2 - l.y1);
          if (x < l.x1 + (vt * (l.x2 - l.x1))) {
            ++wn;
          }
        }
        if (l.y1 > y && l.y2 <= y) {
          double vt = (y - l.y1) / (l.y2 - l.y1);
          if (x < (l.x1 + (vt * (l.x2 - l.x1)))) {
            --wn;
          }
        }
      }
      return wn > 0;
    }
  }

  /**
   * http://qiita.com/p_shiki37/items/65c18f88f4d24b2c528b
   */
  static class FastScanner {
    private final InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    public FastScanner(InputStream in) {
      this.in = in;
    }

    private static boolean isPrintableChar(int c) {
      return 33 <= c && c <= 126;
    }

    private boolean hasNextByte() {
      if (ptr < buflen) {
        return true;
      } else {
        ptr = 0;
        try {
          buflen = in.read(buffer);
        } catch (IOException e) {
          e.printStackTrace();
        }
        if (buflen <= 0) {
          return false;
        }
      }
      return true;
    }

    private int readByte() {
      if (hasNextByte()) return buffer[ptr++];
      else return -1;
    }

    private void skipUnprintable() {
      while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
    }

    public boolean hasNext() {
      skipUnprintable();
      return hasNextByte();
    }

    public String next() {
      if (!hasNext()) throw new NoSuchElementException();
      StringBuilder sb = new StringBuilder();
      int b = readByte();
      while (isPrintableChar(b)) {
        sb.appendCodePoint(b);
        b = readByte();
      }
      return sb.toString();
    }

    public long nextLong() {
      if (!hasNext()) throw new NoSuchElementException();
      long n = 0;
      boolean minus = false;
      int b = readByte();
      if (b == '-') {
        minus = true;
        b = readByte();
      }
      if (b < '0' || '9' < b) {
        throw new NumberFormatException();
      }
      while (true) {
        if ('0' <= b && b <= '9') {
          n *= 10;
          n += b - '0';
        } else if (b == -1 || !isPrintableChar(b)) {
          return minus ? -n : n;
        } else {
          throw new NumberFormatException();
        }
        b = readByte();
      }
    }
  }

  static class Pair<F extends Comparable<F>, S extends Comparable<S>> implements Comparable<Pair<F, S>> {
    F f;
    S s;

    Pair() {
    }

    Pair(F f, S s) {
      this.f = f;
      this.s = s;
    }

    Pair(Pair<F, S> p) {
      f = p.f;
      s = p.s;
    }

    @Override
    public int compareTo(Pair<F, S> p) {
      if (f.compareTo(p.f) != 0) {
        return f.compareTo(p.f);
      }
      return s.compareTo(p.s);
    }

    @Override
    public int hashCode() {
      return f.hashCode() ^ s.hashCode();
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || this.f == null || this.s == null) {
        return false;
      }
      if (this.getClass() != o.getClass()) {
        return false;
      }
      Pair p = (Pair) o;
      return this.f.equals(p.f) && this.s.equals(p.s);
    }

    @Override
    public String toString() {
      return "{" + f.toString() + ", " + s.toString() + "}";
    }
  }

  class BIT<T> {
    int n;
    ArrayList<T> bit;
    BiFunction<T, T, T> bif;

    /**
     * 1-indexed なBinary Indexed Treeを構築する
     *
     * @param n   容量
     * @param bif 適用させる関数
     * @param sup 初期値
     */
    BIT(int n, BiFunction<T, T, T> bif, Supplier<T> sup) {
      this.n = n;
      bit = new ArrayList<>(n + 1);
      for (int i = 0; i < n + 1; ++i) {
        bit.add(sup.get());
      }
      this.bif = bif;
    }

    /**
     * iの位置の値をvで更新する
     *
     * @param i index
     * @param v 新しい値
     */
    void set(int i, T v) {
      for (int x = i; x <= n; x += x & -x) {
        bit.set(x, bif.apply(bit.get(x), v));
      }
    }

    /**
     * クエリー
     *
     * @param defaultValue 初期値
     * @param i            index
     * @return [1, i]までfを適用した結果
     */
    T reduce(T defaultValue, int i) {
      T ret = defaultValue;
      for (int x = i; x > 0; x -= x & -x) {
        ret = bif.apply(ret, bit.get(x));
      }
      return ret;
    }
  }

  class SegmentTree<T> {
    int n;
    ArrayList<T> dat;
    BiFunction<T, T, T> bif;
    Supplier<T> sup;

    /**
     * 0-indexed なSegment Treeを構築する
     *
     * @param n_  要求容量
     * @param bif 適用させる関数
     * @param sup 初期値
     */
    SegmentTree(int n_, BiFunction<T, T, T> bif, Supplier<T> sup) {
      n = 1;
      while (n < n_) n *= 2;

      dat = new ArrayList<>(2 * n - 1);
      for (int i = 0; i < 2 * n - 1; ++i) {
        dat.add(sup.get());
      }
      this.bif = bif;
      this.sup = sup;
    }

    /**
     * kの位置の値をvで更新する
     *
     * @param k index
     * @param v 新しい値
     */
    void set(int k, T v) {
      k += n - 1;
      dat.set(k, v);
      while (k > 0) {
        k = (k - 1) / 2;
        dat.set(k, bif.apply(dat.get(k * 2 + 1), dat.get(k * 2 + 2)));
      }
    }

    /**
     * クエリー
     *
     * @param l はじめ
     * @param r おわり
     * @return [l, r)での演算bifを適用した結果を返す
     */
    T reduce(int l, int r) {
      return _reduce(l, r, 0, 0, n);
    }

    T _reduce(int a, int b, int k, int l, int r) {
      if (r <= a || b <= l) return sup.get();
      if (a <= l && r <= b) return dat.get(k);
      T vl = _reduce(a, b, k * 2 + 1, l, (l + r) / 2);
      T vr = _reduce(a, b, k * 2 + 2, (l + r) / 2, r);
      return bif.apply(vl, vr);
    }
  }

  class UnionFind {
    int[] par;

    UnionFind(int n) {
      par = new int[n];
      for (int i = 0; i < n; ++i) {
        par[i] = i;
      }
    }

    int find(int x) {
      if (par[x] == x) {
        return x;
      }
      return par[x] = find(par[x]);
    }

    boolean same(int x, int y) {
      return find(x) == find(y);
    }

    void union(int x, int y) {
      x = find(x);
      y = find(y);
      if (x == y) {
        return;
      }
      par[x] = y;
    }
  }
}

import java.util.*;

import org.xml.sax.HandlerBase;

import java.io.*;
import java.lang.*;
public class B834 {
	private static long mod = 1000000007;

	public static void main(String[] args) {
		InputReader in=new InputReader(System.in);
		PrintWriter pw=new PrintWriter(System.out);

		int n=in.nextInt();
		int k=in.nextInt();
		String string=in.nextLine();
		HashMap<Integer,Character> hm=new HashMap<>();
		for (int i=n-1;i>=0;i--){
			if (!hm.containsValue(string.charAt(i))){
				hm.put(i,string.charAt(i));
			}
		}
		boolean flag=true;
		HashSet<Character> set=new HashSet<>();
		for(int i=0;i<n;i++) {
			set.add(string.charAt(i));
			if(set.size()>k){
				flag=false;
				//pw.println("YES");
				break;
			}
			if(hm.containsKey(i)) {
				set.remove(hm.get(i));
			}

		}

		if(flag==true)
			pw.println("NO");
		else
			pw.println("YES");

		pw.flush();
		pw.close();
	}

	static class InputReader {

		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}
		public long[] nextLongArray(int n) {
			long a[] = new long[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextLong();
			}
			return a;
		}

		public String readString() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}

	public static int[] suffle(int[] a,Random gen)
	{
		int n = a.length;
		for(int i=0;i<n;i++)
		{
			int ind = gen.nextInt(n-i)+i;
			int temp = a[ind];
			a[ind] = a[i];
			a[i] = temp;
		}
		return a;
	}

	public static void swap(int a, int b){
		int temp = a;
		a = b;
		b = temp;
	}

	public static ArrayList<Integer> primeFactorization(int n)
	{
		ArrayList<Integer> a =new ArrayList<Integer>();
		for(int i=2;i*i<=n;i++)
		{
			while(n%i==0)
			{
				a.add(i);
				n/=i;
			}
		}
		if(n!=1)
			a.add(n);
		return a;
	}

	public static void sieve(boolean[] isPrime,int n)
	{
		for(int i=1;i<n;i++)
			isPrime[i] = true;

		isPrime[0] = false;
		isPrime[1] = false;

		for(int i=2;i*i<n;i++)
		{
			if(isPrime[i] == true)
			{
				for(int j=(2*i);j<n;j+=i)
					isPrime[j] = false;
			}
		}
	}

	public static int GCD(int a,int b)
	{
		if(b==0)
			return a;
		else
			return GCD(b,a%b);
	}

	public static long GCD(long a,long b)
	{
		if(b==0)
			return a;
		else
			return GCD(b,a%b);
	}

	public static long LCM(long a,long b)
	{
		return (a*b)/GCD(a,b);
	}

	public static int LCM(int a,int b)
	{
		return (a*b)/GCD(a,b);
	}

	public static int binaryExponentiation(int x,int n)
	{
	    int result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=result * x;
	        x=x*x;
	        n=n/2;
	    }
	    return result;
	}

	public static long binaryExponentiation(long x,long n)
	{
	    long result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=result * x;
	        x=x*x;
	        n=n/2;
	    }
	    return result;
	}

	public static int modularExponentiation(int x,int n,int M)
	{
	    int result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=(result * x)%M;
	        x=(x*x)%M;
	        n=n/2;
	    }
	    return result;
	}

	public static long modularExponentiation(long x,long n,long M)
	{
	    long result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=(result * x)%M;
	        x=(x*x)%M;
	        n=n/2;
	    }
	    return result;
	}

	public static int modInverse(int A,int M)
	{
	    return modularExponentiation(A,M-2,M);
	}

	public static long modInverse(long A,long M)
	{
	    return modularExponentiation(A,M-2,M);
	}

	public static boolean isPrime(int n)
	{

	    if (n <= 1)  return false;
	    if (n <= 3)  return true;

	    if (n%2 == 0 || n%3 == 0)
	    	return false;

	    for (int i=5; i*i<=n; i=i+6)
	    {
	        if (n%i == 0 || n%(i+2) == 0)
	           return false;
	    }

	    return true;
	}

	static class pair implements Comparable<pair>
	{
		Integer x, y;
		pair(int x,int y)
		{
			this.x=x;
			this.y=y;
		}

		public int compareTo(pair o) {
			int result = x.compareTo(o.x);
			if(result==0)
				result = y.compareTo(o.y);

			return result;
		}
	}
}

import java.io.*;
import java.util.*;
public final class code
// public class Main
// class code
// public class Solution
{
    static void solve()throws IOException
    {
        int first[]=new int[128];
        int last[]=new int[128];
        Arrays.fill(first,inf);
        Arrays.fill(last,0);
        int n=nextInt();
        int k=nextInt();
        int count=0;
        String s=" "+nextLine();
        for(int i=1;i<=n;i++)
        {
            first[s.charAt(i)]=min(first[s.charAt(i)],i);
            last[s.charAt(i)]=max(last[s.charAt(i)],i);
        }
        int maxcount=0;
        for(int i=1;i<=n;i++)
        {
            if(first[s.charAt(i)]==i)
                count++;
            maxcount=max(count,maxcount);
            if(last[s.charAt(i)]==i)
                count--;

        }
        if(maxcount>k)
            out.println("YES");
        else
            out.println("NO");
    }

    ///////////////////////////////////////////////////////////
    public static void main(String args[])throws IOException
    {
        br=new BufferedReader(new InputStreamReader(System.in));
        out=new PrintWriter(new BufferedOutputStream(System.out));
        random=new Random();

        solve();

        // int t=nextInt();
        // for(int i=1;i<=t;i++)
        // {
        //    // out.print("Case #"+i+": ");
        //     solve();
        // }

        out.close();
    }

    static final long mod=(int)(1e9+7);
    static final int inf=(int)(1e9+1);
    // static final long inf=(long)(1e18);

    static class Pair implements Comparable<Pair>
    {
        int first,second;
        Pair(int a,int b)
        {
            first=a;
            second=b;
        }
        public int compareTo(Pair p)
        {
            return first==p.first?second-p.second:first-p.first;
        }
        public boolean equals(Object o)
        {
            Pair p=(Pair)o;
            return first==p.first?second==p.second:false;
        }
        public int hashCode()
        {
            return (int)((1l*first*inf+second)%mod);
        }
        public String toString()
        {
            return first+" "+second;
        }
    }
    static class Triplet implements Comparable<Triplet>
    {
        int first,second,third;
        Triplet(int a,int b,int c)
        {
            first=a;
            second=b;
            third=c;
        }
        public int compareTo(Triplet p)
        {
            return second-p.second;
        }
        public String toString()
        {
            return first+" "+second+" "+third;
        }
    }

    static long modinv(long x)
    {
        return modpow(x,mod-2);
    }
    static long modpow(long a,long b)
    {
        if(b==0)
            return 1;
        long x=modpow(a,b/2);
        x=(x*x)%mod;
        if(b%2==1)
            return (x*a)%mod;
        return x;
    }
    static long gcd(long a,long b)
    {
        if(a==0)
            return b;
        return gcd(b%a,a);
    }
    static int max(int ... a)
    {
    int ret=a[0];
    for(int i=1;i<a.length;i++)
    ret=Math.max(ret,a[i]);
    return ret;
    }
    static int min(int ... a)
    {
    int ret=a[0];
    for(int i=1;i<a.length;i++)
    ret=Math.min(ret,a[i]);
    return ret;
    }
    static void debug(Object ... a)
    {
    System.out.print("> ");
    for(int i=0;i<a.length;i++)
    System.out.print(a[i]+" ");
    System.out.println();
    }
    static void debug(int a[]){debuga(Arrays.stream(a).boxed().toArray());}
    static void debug(long a[]){debuga(Arrays.stream(a).boxed().toArray());}
    static void debuga(Object a[])
    {
    System.out.print("> ");
    for(int i=0;i<a.length;i++)
    System.out.print(a[i]+" ");
    System.out.println();
    }
    static Random random;
    static BufferedReader br;
    static StringTokenizer st;
    static PrintWriter out;
    static String nextToken()throws IOException
    {
    while(st==null || !st.hasMoreTokens())
    st=new StringTokenizer(br.readLine());
    return st.nextToken();
    }
    static String nextLine()throws IOException
    {
    return br.readLine();
    }
    static int nextInt()throws IOException
    {
    return Integer.parseInt(nextToken());
    }
    static long nextLong()throws IOException
    {
    return Long.parseLong(nextToken());
    }
    static double nextDouble()throws IOException
    {
    return Double.parseDouble(nextToken());
    }
}

import java.io.*;
import java.util.*;

public class Main {
    private void solve() {
        int n = nextInt();
        int m = nextInt();
        int ohrana=0;
        String s = next();
        char c[] = s.toCharArray();
        boolean a[] = new boolean[26];
        int end[] = new int[26];
        Arrays.fill(a,false);
        Arrays.fill(end,-1);
        for (int i = 0; i < n; i++) {
            end[c[i]-65]=i;
        }
        for (int i = 0; i < n; i++) {
            if(!a[c[i]-65]) {
                a[c[i] - 65] = true;
                ohrana++;
            }
            if(ohrana>m){
                out.print("Yes");
                break;
            }
            if (end[c[i]-65]==i) {
                a[c[i]-65]=false;
                ohrana--;
            }
            if(i==n-1)out.print("No");
        }
    }
    public static void main(String[] args) {
        new Main().run();
    }

    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;

    private void run() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            //br = new BufferedReader(new FileReader("birthday.in"));
            //out = new PrintWriter(new FileWriter("birthday.out"));
            solve();
            br.close();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private int nextInt() {
        return Integer.parseInt(next());
    }

    private String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
                return "END_OF_FILE";
            }
        }
        return st.nextToken();
    }
}

import java.util.*;
import java.io.*;
public class Main{
  /*
  .
  .
  .
  .
  .
  .
  .
  some constants
  .
  */
  static int i=0,j=0,k=0,l=0;
  /*
  .
  .
  .
  if any
  .
  .
  */
  public static void main(String[] args) throws IOException{
		/*
		.
		.
		.
		.
		.
		.
		*/
    int n=ni();
    int k=ni();
    String str=ns();
    HashMap<Character,Integer> h = new HashMap<>(2*n);
    HashMap<Character,Boolean> c = new HashMap<>(2*n);
    int len=str.length();
    char ch='a';
    int temp=0;
    boolean flag=true;
    for(i=0;i<len;i++){
      ch=str.charAt(i);
      temp=h.getOrDefault(ch,0);
      temp++;
      h.put(ch,temp);
    }
    i=0;
    while(k>=0 && i<len){
      ch=str.charAt(i);
      temp=h.get(ch);
    //  sop(temp+" "+ch);
      flag=c.getOrDefault(ch,true);
      if(temp>1 && flag){
        k--;
        c.put(ch,false);
      }
      else if(!flag && temp==1){
        k++;
      }
      if(temp==1 && k<=0)
        break;
      temp--;
      h.replace(ch,temp);
      i++;
    }
    if(k<=0)
      sop("YES");
    else
      sop("NO");
    /*
		.
		.
		.
		.
		.
		.
		.
		*/
	}
	/*
	temporary functions
	.
	.
	*/

	/*
	fuctions
	.
	.
	.
	.
	.
	.
	.
	.
	.
	.
	.
	.
	.
	.
	.
	.
	.
	abcdefghijklmnopqrstuvwxyz
	.
	.
	.
	.
	.
	.
	*/
	static int modulo(int j,int m){
		if(j<0)
			return m+j;
		  if(j>=m)
			return j-m;

			return j;
	}
	static final int mod=1000000007;
	static final double eps=1e-8;
	static final long inf=100000000000000000L;
	static final boolean debug=true;
	static Reader in=new Reader();
	static StringBuilder ans=new StringBuilder();
	static long powm(long a,long b,long m){
		long an=1;
		long c=a;
		while(b>0){
			if(b%2==1)
				an=(an*c)%m;
			c=(c*c)%m;
			b>>=1;
		}
		return an;
	}
	static Random rn=new Random();
	static void sop(Object a){System.out.println(a);}
	static int ni(){return in.nextInt();}
	static int[] nia(int n){int a[]=new int[n];for(int i=0;i<n;i++)a[i]=ni();return a;}
	static long nl(){return in.nextLong();}
	static long[] nla(int n){long a[]=new long[n];for(int i=0; i<n; i++)a[i]=nl();return a;}
	static String ns(){return in.next();}
	static String[] nsa(int n){String a[]=new String[n];for(int i=0; i<n; i++)a[i]=ns();return a;}
	static double nd(){return in.nextDouble();}
	static double[] nda(int n){double a[]=new double[n];for(int i=0;i<n;i++)a[i]=nd();return a;}
	static class Reader{
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public Reader(){
			reader=new BufferedReader(new InputStreamReader(System.in),32768);
			tokenizer=null;
		}
		public String next(){
			while(tokenizer==null || !tokenizer.hasMoreTokens()){
				try{
					tokenizer=new StringTokenizer(reader.readLine());
				}
				catch(IOException e){
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt(){
			return Integer.parseInt(next());
		}
		public long nextLong(){
			return Long.parseLong(next());
		}
		public double nextDouble(){
			return Double.parseDouble(next());
		}
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Liavontsi Brechka
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static
    @SuppressWarnings("Duplicates")
    class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            String queue = in.next();

            int[] open = new int[26];
            int[] close = new int[26];
            Arrays.fill(open, -1);
            Arrays.fill(close, -1);

            char next;
            for (int i = 0; i < n; i++) {
                next = queue.charAt(i);
                if (open[next - 'A'] == -1) open[next - 'A'] = i;
                close[next - 'A'] = i;
            }

            int numberOpened = 0;
            for (int i = 0; i < n; i++) {
                next = queue.charAt(i);
                if (open[next - 'A'] == i) numberOpened++;

                if (numberOpened > k) {
                    out.print("YES");
                    return;
                }

                if (close[next - 'A'] == i) numberOpened--;
            }

            out.print("NO");
        }

    }

    static class InputReader {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(readLine());
            }
            return tokenizer.nextToken();
        }

        public String readLine() {
            String line;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Reader in = new Reader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Reader in, PrintWriter out) {
            int[] ent = new int[26];
            int[] dp = new int[26];
            int g = in.nextInt();
            int k = in.nextInt();

            char[] guests = in.nextString().toCharArray();
            for (int i = 0; i < g; i++) {
                ent[guests[i] - 'A'] += 1;
            }

            int n = 0;
            int i = 0;
            int max = 0;
            for (i = 0; i < g; i++) {
                dp[guests[i] - 'A'] += 1;
                if (dp[guests[i] - 'A'] == 1) {
                    //new guard for every new entrance,first Occ.
                    n += 1;
                    if (max < n) {
                        max = n;
                    }
                }
                if (dp[guests[i] - 'A'] == ent[guests[i] - 'A']) {
                    //remove guard, for every last entrance
                    n -= 1;
                }

            }

            if (max > k) {
                out.println("YES");
            } else {
                out.println("NO");
            }

        }

    }

    static class Reader {
        private InputStream mIs;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public Reader() {
            this(System.in);
        }

        public Reader(InputStream is) {
            mIs = is;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = mIs.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}

import java.util.*;
import java.util.ArrayList;
public class Main{

   static class Pair
   {
      int x;
      int y;

      Pair(int x, int y){
         this.x=x;
         this.y=y;
      }

   }

    public static void main(String[] args){
     Scanner param = new Scanner(System.in);

      int n=param.nextInt();
      int k=param.nextInt();
      int count=0;
      HashSet<Integer>h=new HashSet<>();
      int arr[]=new int[26];

      String s=param.next();
      for(int i=0;i<s.length();i++){
         arr[s.charAt(i)-'A']=i;
      }
      for(int i=0;i<s.length()-1;i++){
         h.add(s.charAt(i)-'A');
         if(h.size()>k){
            System.out.println("YES");
            return ;
         }
         if(arr[s.charAt(i)-'A']==i){
            h.remove(s.charAt(i)-'A');
         }

      }

         System.out.println("NO");

}
}

import java.util.*;
import java.io.*;
import java.math.*;
public class Codechef{
    static FR in;
    public static void main(String[] args)throws Exception{
    	in =new FR();

    	int n=ni(), k=ni();
    	String s =n();
    	int[] pref =new int[26];
    	int[] suff =new int[26];
    	for( int i=0;i<26;i++ ){ pref[i]=-1; suff[i]=-1; }
    	for( int i=s.length()-1;i>=0;i-- )
    		if( suff[(int)(s.charAt(i)-'A')]==-1 )suff[(int)(s.charAt(i)-'A')]=i;
    	for( int i=0;i<s.length();i++ )
    		if( pref[(int)(s.charAt(i)-'A')]==-1 )pref[(int)(s.charAt(i)-'A')]=i;

    	int add[]=new int[s.length()+1];
    	for( int i=0;i<26;i++ ){
    		if( pref[i]!=-1 ){ add[pref[i]]++; add[suff[i]+1]--; }
    	}
    	for( int i=1;i<s.length();i++ ){
    		add[i]+=add[i-1];
    	}
    	int max=0;
    	for( int i=0;i<s.length();i++ )max=Math.max(max, add[i]);
    	pn(max<=k ? "No": "Yes");
    }

    static long[]la( int N ){
    	long[]a=new long[N];
    	for( int i=0;i<N;i++ )a[i]=nl();
    	return a;
    }

    static int[] ia(int N){
        int[] a = new int[N+1];
        for(int i = 1; i<=N; i++)a[i] = ni();
        return a;
    }

    static class FR{
        BufferedReader br;
        StringTokenizer st;
        public FR(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next(){
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException  e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine(){
            String str = "";
            try{
                str = br.readLine();
            }catch (IOException e){
                e.printStackTrace();
            }
            return str;
        }
    }

    static void p(Object o){
        System.out.print(o);
    }

    static void pn(Object o){
        System.out.println(o);
    }

    static String n(){
        return in.next();
    }

    static String nln(){
        return in.nextLine();
    }

    static int ni(){
        return Integer.parseInt(in.next());
    }

    static long nl(){
        return Long.parseLong(in.next());
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author David Wu
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt(), k = in.readInt();
            boolean[] doors = new boolean[26];
            int[] lastindex = new int[26];
            if (n >= 26 && k == 26 || n <= k) {
                out.printLine("NO");
                return;
            }
            Arrays.fill(lastindex, -1);
            char[] s = in.readString().toCharArray();
            for (int i = n - 1; i >= 0; i--) {
                if (lastindex[(int) s[i] - 65] == -1) {
                    lastindex[(int) s[i] - 65] = i;
                }
            }

            for (int i = 0; i < n; i++) {
                int c = s[i] - 65;
                if (!doors[c]) {
                    doors[c] = true;
                    k--;
                    if (k < 0) {
                        out.printLine("YES");
                        return;
                    }
                    if (i == lastindex[c]) {
                        k++;
                        doors[c] = false;
                        continue;
                    }
                    continue;
                }
                if (doors[c] && i == lastindex[c]) {
                    k++;
                    doors[c] = false;
                }
            }
            out.printLine("NO");

            //end program
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

import java.util.*;
import java.io.*;

public final class Main {

    public static class Interval{
        int start;
        int finish;
        int count;
        Interval(int start, int finish){
            count = 1;
            this.start = start;
            this.finish = finish;
        }
    }

    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int numGuests = Integer.parseInt(st.nextToken());
        int numGuards = Integer.parseInt(st.nextToken());

        String input = br.readLine();

        List<Interval> list = new ArrayList<>();
        Map<Character, Interval> map = new HashMap<>();
        for(int i = 0; i<numGuests; i++){
            char curChar = input.charAt(i);
            if(map.containsKey(curChar)){
                map.get(curChar).finish = i;
            }else{
                map.put(curChar, new Interval(i,i));
            }
        }

        for(Interval i : map.values()){
            list.add(i);
        }

        Collections.sort(list, new Comparator<Interval>() {
            @Override
            public int compare(Interval o1, Interval o2) {
                return o1.start - o2.start;
            }
        });

        Interval maxInterval = list.get(0);
        Interval prevInterval = list.get(0);
        int longestOverlapLength = 1;
        for(int i = 1; i<list.size(); i++){
            Interval currInterval = list.get(i);
            if(currInterval.start <= maxInterval.finish){
                maxInterval.count++;
                maxInterval.start = currInterval.start;
                maxInterval.finish = Math.min(currInterval.finish, maxInterval.finish);
                prevInterval = currInterval;
                longestOverlapLength = Math.max(longestOverlapLength, maxInterval.count);
            }else {
                maxInterval = prevInterval;
                if(currInterval.start <= maxInterval.finish){
                    maxInterval.count++;
                    maxInterval.start = currInterval.start;
                    prevInterval = currInterval;
                    longestOverlapLength = Math.max(longestOverlapLength, maxInterval.count);
                }else {
                    maxInterval = currInterval;
                }
            }
        }

        System.out.println(longestOverlapLength > numGuards ? "YES" : "NO");
    }
}

	import java.util.*;
	public class Main {
		static int n;
		static int k;
		static String in;
		static int count[];
		public static void main(String[]args) {

			Scanner s =new Scanner(System.in);
			n = s.nextInt();
			k = s.nextInt();
			in = s.next();
			count = new int[26];
			if(isOpen()) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}

		static boolean isOpen() {

			if(k == 26) {
				return false;
			}
			HashMap<Integer , Boolean>isMap =new HashMap<Integer , Boolean>();
			int count1 = 0;
			for(int c = 0;c<n;c++) {
				int index = in.charAt(c)-65;
				count[index]++;
			}

			for(int c=0;c<n;c++) {

				int index = in.charAt(c)- 65;

				if(isMap.containsKey(index) && isMap.get(index)) {
					count[index]--;
					if(count[index] == 0) {
						count1--;
						isMap.remove(index);
					}
				} else {
					isMap.put(index, true);
					count1++;
					count[index]--;
					if(count1 > k) {
						return true;
					}
					if(count[index] == 0) {
						count1--;
						isMap.remove(index);
					}
				}
			}
			return false;
		}
	}

import java.util.*;

public class TestCase
{
    public static void main (String[] args) {
        Scanner ob=new Scanner(System.in);
        int n=ob.nextInt();
        int k=ob.nextInt();
        String s=ob.next();
        int hash[]=new int[99];
        int dp[]=new int[n];
        int flag=0;
        int open=0;
        //System.out.println(hash[25]);
        for(int i=0;i<s.length();i++)
        {
            char ch=s.charAt(i);
            hash[ch]++;
            if(hash[ch]==1){
                //System.out.println(ch);
                int idx=s.lastIndexOf(ch);
                //System.out.println(idx);
                dp[idx]=1;
                //System.out.println(dp[idx]);
                open++;
            }
            //System.out.println(dp[i]);
            //open=open-dp[i];
            //System.out.println(open);
            if(open>k)
            {
                flag=1;
                break;
            }
            open=open-dp[i];
        }
        if(flag==1)
        System.out.println("YES");
        else
        System.out.println("NO");
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author AEroui
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();

            char[] arr = in.next().toCharArray();
            int[] e = new int[26];
            Arrays.fill(e, Integer.MAX_VALUE);
            int[] s = new int[26];
            Arrays.fill(s, Integer.MIN_VALUE);

            for (int i = 0; i < arr.length; ++i) {
                char c = arr[i];
                e[c - 'A'] = Math.min(e[c - 'A'], i);
                s[c - 'A'] = Math.max(s[c - 'A'], i);
            }

            int cur = 0;
            for (int i = 0; i < n; ++i) {
                if (e[arr[i] - 'A'] == i) ++cur;
                if (cur > k) {
                    out.println("YES");
                    return;
                }

                if (s[arr[i] - 'A'] == i) --cur;
                //out.println(cur);

            }

            out.println("NO");

        }

    }
}

import java.io.*;
import java.util.HashSet;
import java.util.StringTokenizer;
public class FestiveEvening {
    public static void main(String[] args) throws IOException, InterruptedException {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int [] a=new int[26];
        int n=sc.nextInt();
        int k=sc.nextInt();
        int count=0;
        String s=sc.nextLine();
        HashSet<Character> set=new HashSet<>();
        for(int i=0;i<n;i++)
        	a[s.charAt(i)-65]++;
        for(int i=0;i<n;i++) {
        	if(!set.contains(s.charAt(i))) {
        		set.add(s.charAt(i));
        		count++;
        		if(count>k) {
        			pw.println("YES");
        			pw.flush();
        			return;
        		}
        	}
        	a[s.charAt(i)-65]--;
        	if(a[s.charAt(i)-65]==0)
        		count--;
        }
        pw.println("NO");
        pw.flush();
    }

    static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream system) {br = new BufferedReader(new InputStreamReader(system));}
        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        public String nextLine()throws IOException{return br.readLine();}
        public int nextInt() throws IOException {return Integer.parseInt(next());}
        public double nextDouble() throws IOException {return Double.parseDouble(next());}
        public char nextChar()throws IOException{return next().charAt(0);}
        public Long nextLong()throws IOException{return Long.parseLong(next());}
        public boolean ready() throws IOException{return br.ready();}
        public void waitForInput() throws InterruptedException {Thread.sleep(4000);}
    }
 }

import com.sun.corba.se.impl.orbutil.ORBConstants;
import java.io.PrintWriter;

import java.util.*;
import java.util.Arrays ;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.lang.reflect.Array;

public class Test{
     static PrintWriter  pw = new PrintWriter(System.out);
static class Reader
    {

        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }

static int find(long x[],long r){
    int sum =0 ;

    for (int i = 0; i < x.length; i++) {
        if(x[i]==r) return i+1 ;
    }
    return sum ;
}
static int [] find2(int x[][],int temp,int y[]){
    for (int i = 0; i < x.length; i++) {
        int sum=0 ;
        for (int j = 0; j < x.length; j++) {
           sum+=x[j][i] ;
        }
        y[i]=sum ;

    }
   return y;

}
static void found(LinkedList<Integer> l1,String s,LinkedList<Integer> l2){
    for (int i = 0; i < s.length()-1; i++) {
        String temp ="" ;
                temp +=(char)s.charAt(i);
                temp +=(char)s.charAt(i+1);
        if(temp.equals("AB"))l1.add(i) ;
        if(temp.equals("BA"))l2.add(i) ;
    }
}
 static String db(String s){
     StringBuilder b= new StringBuilder(s) ;

     return s+(b.reverse().toString()) ;

 }
 static String btw(String s,char c){
     StringBuilder b= new StringBuilder(s) ;

     return (s+c)+(b.reverse().toString()) ;

 }

    public static void main(String[] args) throws IOException  {

  // Reader  in =new Reader ();
  Scanner  in =new Scanner (System.in);
  int n=in.nextInt() ;
  int k =in.nextInt() ;
  String s= in.next();
  int []x = new int[26] ;
  String temp="" ;
  int c=0  ;
        for (int i = 0; i < s.length(); i++) {
            x[(int)s.charAt(i)-65]++ ;
        }
        for (int i = 0; i < s.length(); i++) {

            if(!temp.contains(Character.toString(s.charAt(i)))){
                temp+=s.charAt(i) ;
                c++ ;
            }
         //   System.out.println(temp);

            if(c>k){
               System.out.println("YES");
              return ;
            }
            x[(int)s.charAt(i)-65]-- ;
            if(x[(int)s.charAt(i)-65]==0)c--  ;
        }
        System.out.println("NO");
        pw.close();
}
}

import java.util.*;

public class Solution
{
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int k=in.nextInt();
		String s=in.next();
		HashSet hs = new HashSet<Integer>();
		int[] a=new int[26];
		for(int i=0;i<s.length();i++)
			a[s.charAt(i)-'A']=i;

		for(int i=0;i<s.length();i++)
		{
			hs.add(s.charAt(i)-'A');
			if(hs.size()>k)
				{
					System.out.println("YES");
					System.exit(0);
				}
			if(a[s.charAt(i)-'A']==i)
			hs.remove(s.charAt(i)-'A');

		}
			System.out.println("NO");
	}
}

import java.util.*;
import java.io.*;

public class Random {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        if(n>k){
            String s=sc.next();
            int[] count=new int[26];
            for(int i=0;i<s.length();i++){
                count[s.charAt(i)-'A']++;
            }
            //System.out.println(Arrays.toString(count));

            boolean[] visited=new boolean[26];
            for(int i=0;i<26;i++){
                visited[i]=false;
            }

            for(int i=0;i<s.length();i++){

                if(visited[s.charAt(i)-'A']==true){
                    count[s.charAt(i) - 'A']--;
                }
                else if(visited[s.charAt(i)-'A']==false){
                    count[s.charAt(i) - 'A']--;
                    visited[s.charAt(i)-'A']=true;
                    k--;
                    //System.out.println(k);
                }

                if(k<0){
                    break;
                }

                if(count[s.charAt(i)-'A']==0){
                    k++;
                    //System.out.println(k);
                }

            }

            if(k>0){
                System.out.println("NO");
            }
            else
                System.out.println("YES");

        }
        else
            System.out.println("NO");
    }
}

import java.util.HashMap;
import java.util.Scanner;

public class Intrusion {
    private static Scanner in = new Scanner(System.in);

    public static void main(String[] args) {
        int n= in.nextInt(),k=in.nextInt();
        HashMap<Character,Integer> map = new HashMap<>();
        boolean[] gates = new boolean[26];
        String s=in.next();
        for(int i=0;i<n;i++){
            if(!map.containsKey(s.charAt(i))){
                map.put(s.charAt(i), s.lastIndexOf(s.charAt(i)));
            }
        }
        for(int i=0;i<n;i++){
            int index =(int) s.charAt(i)-'A';
            if(!gates[index]){
                gates[index]=true;
                if(k<=0) {
                    System.out.println("YES");
                    return;
                }
                k--;
            }
            if(map.get(s.charAt(i))==i){
                gates[index] = false;
                k++;
            }
        }
        System.out.println("NO");

    }

}

import java.util.*;
import java.math.*;
import java.io.*;
import java.text.*;

public class practice {
    public static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        } else {
            return gcd(b, a % b);
        }
    }

    public static int mod(int a, int b, int m) {
        if (b == 0) {
            return 1;
        } else if (b == 1) {
            return a % m;
        } else {
            if (b % 2 == 0) {
                return ((mod(a, b / 2, m) % m) * (mod(a, b / 2, m)) % m) % m;
            } else {
                return (a * ((mod(a, b / 2, m) % m) * (mod(a, b / 2, m)) % m)) % m;
            }
        }
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int k = Integer.parseInt(st.nextToken());
        int a[] = new int[26];
        int b[] = new int[26];
        String s = br.readLine();
        for(int i=0;i<n;i++){
            int t = s.charAt(i)-'A';
            a[t]++;
        }
        int curr = 0;
        boolean flag = true;
        for(int i=0;i<n;i++){
            int t = s.charAt(i)-'A';
            if(curr>k){
                flag = false;
                break;
            }
            else{
                b[t]++;
                if(b[t] == 1){
                    curr++;
                    if(curr>k){
                        flag = false;
                        break;
                    }
                }
                if(b[t] == a[t]){
                    curr--;
                }
            }
        }
        if(flag){
            System.out.println("NO");
        }
        else{
            System.out.println("YES");
        }
    }
}

class sort implements Comparator<ArrayList<Long>> {

    @Override
    public int compare(ArrayList<Long> o1, ArrayList<Long> o2) {
        int c = o1.get(2).compareTo(o2.get(2));
        return c;
    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;

public class FestiveEvening {
    Node[] arr = new Node[26];
    static class Node{
        int l = -1;
        int r = -1;
        boolean stat = false;
        Node(int l, int r){
            this.l = l;
            this.r = r;
        }
    }
    public void insert(int x, int i){
        if(arr[x]==null){
            Node n = new Node(i,-1);
            arr[x] = n;
        }
        else{
            arr[x].r = i;
        }
    }
    public int checkActive(int day){
        int count = 0;
        for(int i=0; i<arr.length; i++){
            if(arr[i]!=null){
                if(arr[i].l==day) {
                    arr[i].stat = true;
                }
                if(arr[i].r==day-1){
                    arr[i].stat = false;
                }
                if(arr[i].stat==true){
                    count++;
                }
            }
        }
        return count;
    }
    public static void main(String[] args) throws IOException{
        Reader.init(System.in);
        int n = Reader.nextInt();
        int k = Reader.nextInt();
        FestiveEvening h = new FestiveEvening();
        String s = Reader.next();
        for(int i=0; i<n; i++){
            char c = s.charAt(i);
            int x = (int)c - 65;
            h.insert(x,i);
        }
        for(int i=0; i<26; i++){
            if(h.arr[i] != null && h.arr[i].r==-1){
                h.arr[i].r = h.arr[i].l;
            }
        }
        int activeCount = 0;
        int sg = 0;
        for(int i=0; i<=n; i++){
            activeCount = h.checkActive(i);
            if(activeCount>k){
                sg = 1;
            }
        }
        if(sg==1){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }
    }
}
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }

    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }
}

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int doors = scn.nextInt();
        int guards = scn.nextInt();
        scn.nextLine();
        String str = scn.nextLine();

        Map<Character, Integer> count = new HashMap<Character, Integer>();
        Map<Character, Integer> map = new HashMap<Character, Integer>();
        int counter = 0;
        int flag = 1;
        for (int i = 0; i < str.length(); i++) {
            if (count.containsKey(str.charAt(i))) {
                count.put(str.charAt(i), count.get(str.charAt(i)) + 1);
            } else {
                count.put(str.charAt(i), 1);
            }
        }

        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (count.containsKey(ch)) {
                if (!map.containsKey(ch)) {
                    map.put(ch, 1);
                    counter++;

                    if (counter > guards) {
                        flag = 0;
                        break;
                    }
                }
                count.put(ch, count.get(ch) - 1);
                if (count.get(ch) == 0)
                    counter--;
            }
        }
        if (flag == 0)
            System.out.println("YES");
        else
            System.out.println("NO");
    }

}

import java.util.Scanner;

public class Problems {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String st = sc.next();
        int[][] matrix = new int[26][2];
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[i].length; j++) {
                matrix[i][j] = -1;
            }
        }
        for (int i = 0; i < st.length(); i++) {
            char c = st.charAt(i);
            if (matrix[c - 65][0] == -1) {
                matrix[c - 65][0] = i;
            }
            if (matrix[c - 65][1] < i) {
                matrix[c - 65][1] = i;
            }
        }

        int numberOfOpenDoors = 0;

        for (int i = 0; i < st.length(); i++) {
            char c = st.charAt(i);
            if (matrix[c - 65][0] == i) {
                numberOfOpenDoors++;
            }
            if (numberOfOpenDoors > k) {
                System.out.println("YES");
                System.exit(0);
            }
            if (matrix[c - 65][1] == i) {
                numberOfOpenDoors--;
            }

        }
        System.out.println("NO");
    }
}

/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
public class S {
	public static void main (String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int k=in.nextInt();
		String s=in.next();
		Map<Character,Integer> map=new HashMap<>();
		for(int i=0;i<n;i++)
		{
		    if(!map.containsKey(s.charAt(i)))map.put(s.charAt(i),i);
		    else map.put(s.charAt(i),i);
		}

		    Map<Character,Integer> temp=new HashMap<>();
		    int flag=0;
		    for(int i=0;i<n;i++)
		    {
		        if(!temp.containsKey(s.charAt(i)))temp.put(s.charAt(i),0);
		        if(temp.size()>k)
		        {
		            flag=1;
		            break;
		        }
		        if(map.get(s.charAt(i))==i)
		        {
		            temp.remove(s.charAt(i));
		        }
		    }
		    //System.out.print(temp.size());
		    if(flag==1)System.out.print("YES");
		    else System.out.print("NO");

	}
}

import java.util.*;

public class Darshjava
{
    public static void main(String args [])
    {
        Scanner enter = new Scanner (System.in) ;
        int n = enter.nextInt() , k = enter.nextInt() , gates [] = new int [26]
        , deployed = 0 , guards = 1 ;
        char letters [] = new char [26] ;
        String doors = enter.next() ;
        for (int i = 65 ; i <= 90 ; i++ )
            letters[i-65] = (char) i ;
        for (int j = 0 ; j < 26 ; j++)
            {
                if (doors.charAt(0) == letters[j]) gates[j] = 1 ;
            }
        for(int i = 1 ; i < doors.length() ; i++)
        {
            for (int j = 0 ; j < 26 ; j++)
                if (doors.charAt(i) == letters[j]
                   && doors.charAt(i-1) != doors.charAt(i))
                {
                        if(gates[j] == 0){ guards ++ ;gates[j] = 1 ; }
                        else if(gates[j] == 1 && guards > k) {gates[j]++ ;  deployed++ ;}
                        else if(gates[j] >= 2 && guards > k) {gates[j]++ ;  deployed++ ;}
                }
            if (deployed > k && i != doors.length()-1)
            {System.out.println("YES"); System.exit(0);}
            else if (deployed >= k && i == doors.length()-1)
            {System.out.println("YES"); System.exit(0);}
        }
        System.out.println("NO");
    }
}

//package TIM;

import java.lang.reflect.Array;
import java.math.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int k = input.nextInt();
        char[] s = new char[1000005];
        s = input.next().toCharArray();
        int[] close = new int[26];
        int[] open = new int[26];
        for (int i = 0; i < n; i++)
            close[s[i] - 'A'] = i;
        for (int i = n - 1; i >= 0; i--)
            open[s[i] - 'A'] = i;
        int door = 0;
        for (int i = 0; i < n; i++) {
            if (i == open[s[i] - 'A']) {
                door++;
            }
            if (door > k) {
                System.out.println("YES");
                return;
            }
            if (i == close[s[i] - 'A']) {
                door--;
            }
        }
        System.out.println("NO");
    }
}

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();
		System.out.println(solve(s, k) ? "YES" : "NO");

		sc.close();
	}

	static boolean solve(String s, int k) {
		int n = s.length();

		boolean[] firsts = new boolean[n];
		boolean[] lasts = new boolean[n];
		s.chars().distinct().forEach(ch -> {
			firsts[s.indexOf(ch)] = true;
			lasts[s.lastIndexOf(ch)] = true;
		});

		int openNum = 0;
		for (int i = 0; i < n; i++) {
			if (firsts[i]) {
				openNum++;

				if (openNum > k) {
					return true;
				}
			}

			if (lasts[i]) {
				openNum--;
			}
		}

		return false;
	}
}

import java.util.Scanner;

public class Main {
    public static void main(String args[])
            throws java.io.IOException{
        Scanner in = new Scanner(System.in);

        int s[] = new int[27];
        int d[] = new int[27];
        int n = in.nextInt();
        int k=in.nextInt();
        int k1=k;

        String im = in.next();
        for(int i=0; i<n; i++)
        {
            int b = im.charAt(i)- (char)'A';
            s[b]++;
        }

        for(int i=0; i<n; i++)
        {
            int b = im.charAt(i)- (char)'A';
            if (d[b]==0) k1--;
            d[b]++;
            if(k1<0) {System.out.println("YES");  return;}
            if (d[b]==s[b]) k1++;
        }

        System.out.println("NO");

    }
}

import java.util.Scanner;

public class azx
{

	public static void main(String[] args)
	{
		Scanner cin= new Scanner(System.in);
		int n=cin.nextInt();
		int k=cin.nextInt();
		String str=cin.next();
		int arr[]= new int[n+1];
		for (char c='A';c<='Z';c++)
		{
			if(str.indexOf(""+c)!=-1)
			{
			arr[str.indexOf(""+c)]+=1;
			arr[str.lastIndexOf(""+c)+1]+=-1;
			}
		}
		int min=0;
		for (int i = 1; i <arr.length; i++)
		{
			arr[i]=arr[i]+arr[i-1];
			if(arr[i]>min)
			{
				min=arr[i];
			}
		}
		if(k>=min)
		{
			System.out.println("NO");
		}
		else
		{
			System.out.println("YES");
		}

	}

}

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		sc.nextLine();
		String s=sc.nextLine();
		int c=0,f=0;
		int lastIndex[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
		for(int i=0;i<n;i++)
		{
		    lastIndex[s.charAt(i)-'A']=i;
		}
		char al[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
		for(int i=0;i<n-1;i++)
    	{

	        if(al[s.charAt(i)-'A']==0)
	        {
	            c++;
	            al[s.charAt(i)-'A']=1;
	        }

	        if(c>k) { f=1;
	        break;}

	        if(lastIndex[s.charAt(i)-'A']==i)
	        {
	            c--;
	        }
	    }
	    if(f==0)System.out.println("NO");
	    else System.out.println("YES");
	 }
}

import java.io.*;
import java.util.*;

public class A1008 {
    public static void main(String [] args) /*throws Exception*/ {
        InputStream inputReader = System.in;
        OutputStream outputReader = System.out;
        InputReader in = new InputReader(inputReader);//new InputReader(new FileInputStream(new File("input.txt")));new InputReader(inputReader);
        PrintWriter out = new PrintWriter(outputReader);//new PrintWriter(new FileOutputStream(new File("output.txt")));
        Algorithm solver = new Algorithm();
        solver.solve(in, out);
        out.close();
    }
}

class Algorithm {
    void solve(InputReader ir, PrintWriter pw) {

        int n = ir.nextInt(), k = ir.nextInt(), total = 0;
        String s = ir.next();
        int [] letters = new int [26], gates = new int[26];

        for (int i = 0, num; i < n; i++) {
            num = (int)s.charAt(i) - 'A';
            letters[num] = i;
        }

        for (int i = 0, num; i < n; i++) {
            num = (int)s.charAt(i) - 'A';

            if (gates[num] == 0) {
                gates[num] = 1;
                total++;
            }

            if (total > k) {
                pw.print("YES");
                return;
            }

            if (i >= letters[num]) total--;

        }

        pw.print("NO");

    }

}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    String nextLine(){
        String fullLine = null;
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                fullLine = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return fullLine;
        }
        return fullLine;
    }

    String [] toArray() {
        return nextLine().split(" ");
    }

    int nextInt() {
        return Integer.parseInt(next());
    }
    double nextDouble() {
        return Double.parseDouble(next());
    }
    long nextLong() {
        return Long.parseLong(next());
    }

}

import java.io.*;
import java.util.*;
import java.lang.*;
import static java.lang.System.*;
public class A
{
public static void main (String args[]) throws Exception
{
	Scanner sc=new Scanner(in);
	int n=sc.nextInt();
	int k=sc.nextInt();
	String s=sc.nextLine();
	s=sc.nextLine();
	int count=0;
	char arr[]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
    int brr[]=new int[n];
    for(int i=0;i<n;i++)
    {
		brr[i]=0;
	}
	for(int i=0;i<n;i++)
	{
		int pos=0;
		for(int j=0;j<26;j++)
		{
			if(s.charAt(i)==arr[j])
			pos=j;
		}
		brr[i]=pos+1;
	}
	int start[]=new int[26];
	int stop[]=new int[26];
    for(int i=0;i<26;i++)
    {
		start[i]=-1;
		stop[i]=-1;
	}
	for(int i=0;i<26;i++)
	{
		for(int j=0;j<n;j++)
		{
         if(brr[j]==i+1)
          {start[i]=j+1;break;}
		}
		for(int j=n-1;j>=0;j--)
				{
		         if(brr[j]==i+1)
		          {stop[i]=j+1;break;}
				}

	}
for(int i=0;i<n;i++)
{
	if(count>k)
	{
		out.println("YES");
		exit(0);
	}
	char ch=s.charAt(i);
	int pos=(int)(ch-65);
	if(start[pos]==i+1 && stop[pos]==i+1)
	{
       count++;
     if(count>k)
	{
		out.println("YES");
		exit(0);
	}
	count--;
	}
	else if(start[pos]==i+1)
	{
		count++;
	}
	else if (stop[pos]==i+1)
	{
		count--;
	}

}
out.println("NO");
	}
}
class Number
{
int a;
int b;
int c;
public Number(int x,int y,int z)
{
a=x;
b=y;
c=z;
}
}
class Ch1Comparator implements Comparator<Number>
{
public int compare(Number f1,Number f2)
{
if(f1.a==f2.a)
return 0;
if(f1.a<f2.a)
return -1;
return 1;
}
}
class Ch2Comparator implements Comparator<Number>
{
public int compare(Number f1,Number f2)
{
if(f1.b==f2.b)
return 0;
if(f1.b<f2.b)
return -1;
return 1;
}
}class Ch3Comparator implements Comparator<Number>
{
public int compare(Number f1,Number f2)
{
if(f1.c==f2.c)
return 0;
if(f1.c<f2.c)
return -1;
return 1;
}
}

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		int n, m;
		String s;
		int[] arr = new int[26];
		Arrays.fill(arr, 0);
		Map<Character, Boolean> map = new HashMap<>();

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		m = sc.nextInt();
		sc.nextLine();
		s = sc.nextLine();

		for(int i = 0;i < n;i++)
			arr[s.charAt(i) - 65]++;

		for(int i = 0;i < n;i++) {
			if(map.containsKey(s.charAt(i))) {
				if(arr[s.charAt(i) - 65] == 1)
					m++;
				else
					arr[s.charAt(i) - 65]--;
			} else {
				if(m > 0 && arr[s.charAt(i) - 65] == 1)
					continue;
				if(m > 0) {
					m--;
					arr[s.charAt(i) - 65]--;
					map.put(s.charAt(i), true);
				} else {
					System.out.println("YES");
					return;
				}
			}
		}
		System.out.println("NO");
	}

}

import java.util.Scanner;

public class MainClass {
    public static Scanner input = new Scanner(System.in);
    public static int numberOfVisitorsForEachDoor[] = new int[26];
    public static boolean doorStatue[] = new boolean[26];
    public static int numberOfGuests, numberOfGuards;

    public static void openDoor(int index) {
        doorStatue[index] = true;
    }

    public static void closeDoor(int index) {
        doorStatue[index] = false;
    }

    public static int getNumberOfOpenedDoors() {
        int counter = 0;
        for (int i = 0; i < 26; i++) {
            if (doorStatue[i] == true) counter++;
        }
        return counter;
    }

    public static void main(String[] args) {
        numberOfGuests = input.nextInt();
        numberOfGuards = input.nextInt();
        String entranceSequence = new String(input.next());
        char entranceSequenceArray[] = entranceSequence.toCharArray();
        for (char i : entranceSequenceArray) numberOfVisitorsForEachDoor[i - 'A']++;
        for (char i : entranceSequenceArray) {
            openDoor(i - 'A');
            if (getNumberOfOpenedDoors() > numberOfGuards) {
                System.out.println("YES");
                return;
            }
            numberOfVisitorsForEachDoor[i - 'A']--;
            if (numberOfVisitorsForEachDoor[i - 'A'] == 0) closeDoor(i - 'A');
        }
        if (getNumberOfOpenedDoors() > numberOfGuards) {
            System.out.println("YES");
            return;
        }
        System.out.println("NO");
    }
}

import java.util.HashSet;
import java.util.Scanner;

public class Guards {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt(), k = s.nextInt();
		String str = s.next();
		char[] a = str.toCharArray();
		int[] map = new int[26];
		for (int i = 0; i < n; i++)
			map[a[i] - 65]++;
		boolean ok = false;
		HashSet<Integer> set = new HashSet<>();
		int count = 0;

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

			if (map[a[i] - 65] > 0 && !set.contains((a[i] - 65))) {
				count++;
				set.add(a[i] - 65);
			}

			if (count > k) {
				ok = true;
				break;
			}
			map[a[i] - 65]--;
			if (map[a[i] - 65] == 0) {
				set.remove(a[i] - 65);
				count--;
			}

		}
		System.out.println(ok ? "yes" : "no");
	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class TheFestivalEvening {

	public static void main(String[] args)
	{
		FastReader in = new FastReader();
		int guest = in.nextInt();
		int guard = in.nextInt();
		int[] open = new int[26];
		int[] close = new int[26];

		String str = in.next();
		for(int i = 1; i <= guest; i++)
		{
			char c = str.charAt(i-1);
			int n = ((int)c)-65;
			if(open[n] == 0)
			{
				open[n] = i;
			}
			close[n] = i;
		}
		for(int i = 1; i <= guest; i++)
		{
			if(contains(open,i))
			{
				guard--;
			}
			if(guard < 0)
			{
				System.out.println("YES");
				return;
			}
			if(contains(close,i))
			{
				guard++;
			}
		}
		System.out.println("NO");
	}

	public static boolean contains(int[] arr, int n)
	{
		for(int i : arr)
		{
			if(i==n)
				return true;
		}
		return false;
	}

	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.stream.IntStream;

public class Question {
	public static int found(String tems, int[] doors) {
		for (int i = 0; i < 26; i++) {
			if (doors[i] == 1) {
				char c = (char) (i + 65);
				if (!tems.contains(c + "")) {
					return i;
				}
			}
		}
		return -1;
	}

	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		// StringTokenizer inputData = new StringTokenizer(reader.readLine());
		// int n = Integer.parseInt(inputData.nextToken());
		// int k = Integer.parseInt(inputData.nextToken());
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int k = in.nextInt();
		String s = in.next();

		int[] doors = new int[100];
		int temp = k;
		for (int i = 0; i < n; i++) {
			if (temp == 0) {
				break;
			}
			if (doors[s.charAt(i) - 65] == 0) {
				doors[s.charAt(i) - 65] = 1;
				temp--;
			}
		}
		for (int i = 0; i < n; i++) {
			if (doors[s.charAt(i) - 65] == 0) {
				String tems = s.substring(i + 1, n);
				int f = found(tems, doors);
				if (f == -1) {
					System.out.println("YES");
					return;
				} else {
						doors[f] = 0;
						doors[s.charAt(i)-65] = 1;

				}
			}
		}
		System.out.println("NO");

	}
}

import java.util.Scanner;

/**
 * Created by texnoman on 30.07.17.
 */
public class Main {
    public static void main(String[] args){
        String line;
        String[] lines;
        String doors;
        char[] symbol;
        int[] symbolfinal;

        Scanner scan=new Scanner(System.in);

        line=scan.nextLine();
        lines= line.split(" ");

        doors=scan.nextLine();
        symbol=doors.toCharArray();
        symbolfinal=new int[symbol.length];

        for(int i=0;i<symbol.length;i++) {
            symbolfinal[i]=Character.getNumericValue(symbol[i])-10;
            System.out.println(symbolfinal[i]);
        }

        String resulttest=schet(Integer.parseInt(lines[0]),Integer.parseInt(lines[1]),symbolfinal);
        System.out.println(resulttest);
    }

    public static String schet(int guestcount, int secourity, int[] door){
        int[] schetrazn= new int[26];
        boolean[] opendoors= new boolean[26];
        int opendoorcount=0;

        for(int i=0;i<26;i++) schetrazn[i]=0;
        for(int i=0;i<26;i++) opendoors[i]=false;
        int numberdoor;
        int opendoorcountmax=0;
        for(int i=0;i<guestcount;i++){
            numberdoor=door[i];
            schetrazn[numberdoor]=i;
        }
        /*
        **Счет
         */
String result="NO";
        for(int i=0;i<guestcount;i++){
            numberdoor=door[i];
            if (!opendoors[numberdoor]) {
                opendoorcount++;
                opendoors[numberdoor] = true;
            }
            if(opendoorcount>secourity) {
                result= "YES";
                break;
            }
            if(schetrazn[numberdoor]==i) {
                opendoorcount--;
                opendoors[numberdoor]=false;
            }

        }
        return result;
        }

    }

import java.util.Scanner;

public final class Door {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String str = sc.next();
		int[] az = new int[26];
		int[] last = new int[26];
		boolean[] visited = new boolean[26];
		for(int i=0;i<str.length();i++){
			az[str.charAt(i)-'A']++;
			last[str.charAt(i)-'A']=i;
		}
		String res="";
		for(int i=0;i<str.length();i++){
			if(k<0){
				res="YES";
				break;
			}
			if(last[str.charAt(i)-'A']>i && visited[str.charAt(i)-'A']==false){
				k--;
				visited[str.charAt(i)-'A']=true;
			}
			if(last[str.charAt(i)-'A']==i){
				k++;
			}

		}
		if(res!="YES"){
			res="NO";
		}
		System.out.println(res);

	}

}

import java.io.*;
import java.util.*;
import java.math.*;

/**
 *
 * @author ghost
 */
public class B {

    public static void main(String args[])
    {

        //File file= new File("COMPLETE_FILE_PATH");
        //InputStream is = new FileInputStream(file);

        //InputReader in = new InputReader(is);
        InputReader in = new InputReader(System.in);
        PrintWriter out= new PrintWriter(System.out);

        int t=1;

        Task solver=new Task();
        solver.solve(t,in,out);

        out.flush();
        out.close();

    }

    static class Task {
        long mod = 1000000007;

        public void solve(int testNumber, InputReader in,PrintWriter out){

            int n=in.nextInt();int  k=in.nextInt();

            char[] guest=new char[n];
            guest=in.next().toCharArray();

            int[][] timing=new int[26][2];
            for(int i=0;i<26;i++){
                timing[i][1]=Integer.MIN_VALUE;
                timing[i][0]=Integer.MAX_VALUE;
           }

            for(int i=0;i<guest.length;i++){
                if(timing[guest[i]-'A'][0]>i)  {
                    timing[guest[i]-'A'][0]=i;

                }
                if(timing[guest[i]-'A'][1]<i){
                    timing[guest[i]-'A'][1]=i;
                }
            }

//            for(int i=0;i<26;i++){
//                for(int j=0;j<2;j++){
//                    out.print(timing[i][j]+" ");
//                }
//                out.println();
//            }

            int count=1;
            int last=Integer.MIN_VALUE;
            for(int i=0;i<25;i++){
                if(timing[i][1]>timing[i+1][0])
                    count++;
                last=Math.min(timing[i][1], timing[i+1][1]);
            }

//            out.println(count);
            out.println(k>=count?"NO":"YES");
        }

        int LOG2(long item){
            int count=0;
            while(item>1){
                item>>=1;count++;
            }
            return count;
        }

        long gcd(long a, long b) {
            a = Math.abs(a);
            b = Math.abs(b);
            return BigInteger.valueOf(a).gcd(BigInteger.valueOf(b)).longValue();
        }
    }

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String next() {
            return readString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }

        private static void pa(Object... o) {
            System.out.println(Arrays.deepToString(o));
        }
    }

}

import java.io.*;
import java.util.*;

public class A {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    public static void main(String[] args) throws IOException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter(new File("output.txt"));
        } catch (Exception e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(new OutputStreamWriter(System.out));
        }
        tok = new StringTokenizer("");
        new A().solve();
        out.flush();
        out.close();
    }

    String nextTok() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    String nextLine() throws IOException {
        return in.readLine();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextTok());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextTok());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextTok());
    }

    class Pair implements Comparable<Pair>{
        int a;
        int b;
        Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public int compareTo(Pair o) {
            if (a != o.a) return Integer.compare(a, o.a);
            return Integer.compare(b, o.b);
        }
    }

    void solve() throws IOException {
        int n = nextInt();
        int k = nextInt();
        String str = nextTok();
        int last[] = new int[26];

        for (int i = 0; i < str.length(); i++) {
            last[str.charAt(i)-'A'] = i;
        }

        int curK = 0;
        boolean can = false;
        boolean opened[] = new boolean[26];
        for (int i = 0; i < str.length(); i++) {
            if (last[str.charAt(i)-'A'] > i && !opened[str.charAt(i)-'A']) {
                opened[str.charAt(i)-'A'] = true;
                curK++;
                if (curK > k) can = true;
            } else {
                curK--;
            }
        }

        if (can) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }

}

import java.util.Scanner;

public final class Door {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String str = sc.next();
		int[] az = new int[26];
		int[] last = new int[26];
		boolean[] visited = new boolean[26];
		for(int i=0;i<str.length();i++){
			az[str.charAt(i)-'A']++;
			last[str.charAt(i)-'A']=i;
		}
		String res="";
		for(int i=0;i<str.length();i++){
			if(k<0){
				res="YES";
				break;
			}
			if(last[str.charAt(i)-'A']>i && visited[str.charAt(i)-'A']==false){
				k--;
				visited[str.charAt(i)-'A']=true;
			}
			if(last[str.charAt(i)-'A']==i && visited[str.charAt(i)-'A']==true){
				k++;
			}

		}
		if(res!="YES"){
			res="NO";
		}
		System.out.println(res);

	}

}

import java.util.Arrays;
import java.util.BitSet;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main{
	static Scanner s=new Scanner(System.in);
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static IntStream INS(int n) {return REPS(n).map(i->getInt());}
	static int getInt(){return Integer.parseInt(s.next());}

	public static void main(String[]$){
		int[]c=new int[26];
		Arrays.fill(c,-1);

		BitSet b=new BitSet();

		int n=getInt(),k=getInt();
		char[]in=s.next().toCharArray();

		for(int i=0;i<n;++i) {
			if(c[in[i]-'A']==-1||c[in[i]-'A']==i-1) {
				c[in[i]-'A']=i;
			}else{
				b.set(in[i]-'A');
			}
		}
		System.out.println(b.cardinality()<=k?"YES":"NO");
	}
}

import java.util.*;
public class Main {
	static int a,b,c,x[],y[],N=10000005;
	public static void main(String args[]){
		Scanner reader=new Scanner(System.in);
		int a=reader.nextInt();
		int b=reader.nextInt();
		String s=reader.next();
		int x[]=new int[26];
		int y[]=new int[26];
		int sum=0;
		for(int n=0;n<26;n++){
			x[n]=N;
			y[n]=N;
		}
		for(int n=1;n<=a;n++){
			int t=s.charAt(n-1)-'A';
			if(x[t]==N){
				x[t]=n;
				y[t]=n;
				sum++;
			}
			else{
				y[t]=n;
			}
		}
		int k=0;
		int max=0;
		Arrays.sort(x);
		Arrays.sort(y);
		int num=y[0];
		int st=1;
		for(int n=0;n<sum;n++){
			if(x[n]<=num){
				k++;
				max=Math.max(max, k);
			}
			else{
				k--;
				num=y[st];
				st++;
			}
		}
		if(max>b){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}

	}

}

import java.io.*;
import java.util.*;

public class Solution{

    public static void main(String[] args) throws Exception{
        int[] nk = in.readA();
        int n = nk[0], k = nk[1];
        char[] guest = in.readLine().toCharArray();
        boolean possible = true;
        boolean[] alpha = new boolean[26];
        int[] first = new int[26];
        int[] end = new int[26];
        Arrays.fill(first, -1);
        Arrays.fill(end, -1);
        for(int i = 0; i < n; i++){
            if(first[guest[i] - 'A'] == -1) first[guest[i]-'A'] = i;
            end[guest[i]-'A'] = i;
        }

        int r = -1, c = 0;
        int mx = 0;
        for(int i = 0; i < n; i++){
            r = Math.max(r, end[guest[i] - 'A']);

            if(!alpha[guest[i] - 'A'])
                c++;
            alpha[guest[i] - 'A'] = true;
            if(end[guest[i] - 'A'] == i){
                alpha[guest[i] - 'A'] = false;
                c--;
            }
            mx = Math.max(mx, c);
        }

        if(mx > k)   System.out.println("YES");
        else System.out.println("NO");
    }

    static Inputer in;
    static {
        in = new Inputer();
    }

    static class Inputer{
        BufferedReader br;
        Inputer(){
            try{
                br = new BufferedReader(new InputStreamReader(System.in));
            }
            catch(Exception e){}
        }
        public int readInt() throws Exception{
            return Integer.parseInt(readLine());
        }
        public long readLong() throws Exception{
            return Long.parseLong(readLine());
        }
        public int[] readA(String delim) throws Exception{
            String[] s = readLine().split(delim);
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public int[] readA() throws Exception{
            String[] s = readLine().split("\\s+");
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public long[] readLA() throws Exception{
            String[] s = readLine().split("\\s+");
            long[] A = new long[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Long.parseLong(s[i]);
            return A;
        }
        public String readLine() throws Exception{
            return br.readLine();
        }
        public int[] copyA(int[] A){
            int[] B = new int[A.length];
            for(int i= 0 ; i < A.length; i++)
                B[i] = A[i];
            return B;
        }
    }
}

import java.util.*;
public class solution
{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        String s=sc.next();
        char[] c=s.toCharArray();
        int[] a=new int[26];
        for(int i=0;i<n;i++)
        {
        	int y=c[i]-'A';
        	a[y]++;
        }
        int count=0;
        for(int i=0;i<26;i++)
        {
        	if(a[i]!=0)
        	{
        		count++;
        	}
        }
        if(count<=k)
        {
        	System.out.println("YES");
        }
        else
        {
        	int x=0;
        	for(int i=1;i<n;i++)
        	{
        		if(c[i]!=c[i-1])
        		{
        			x++;
        		}
        	}
        	if(x<=k)
        	{
        		System.out.println("YES");
        	}
        	else
        	{
        		System.out.println("NO");
        	}
        }
    }
}

import java.io.*;
import java.util.*;
import java.lang.*;
import static java.lang.System.*;
public class A
{
public static void main (String args[]) throws Exception
{
	Scanner sc=new Scanner(in);
	int n=sc.nextInt();
	int k=sc.nextInt();
	String s=sc.nextLine();
	s=sc.nextLine();
	int count=1;
	char arr[]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
    int brr[]=new int[n];
    for(int i=0;i<n;i++)
    {
		brr[i]=0;
	}
	for(int i=0;i<n;i++)
	{
		int pos=0;
		for(int j=0;j<26;j++)
		{
			if(s.charAt(i)==arr[j])
			pos=j;
		}
		brr[i]=pos+1;
	}
	int start[]=new int[26];
	int stop[]=new int[26];
    for(int i=0;i<26;i++)
    {
		start[i]=-1;
		stop[i]=-1;
	}
	for(int i=0;i<26;i++)
	{
		for(int j=0;j<n;j++)
		{
         if(brr[j]==i+1)
          {start[i]=j+1;break;}
		}
		for(int j=n-1;j>=0;j--)
				{
		         if(brr[j]==i+1)
		          {stop[i]=j+1;break;}
				}

	}
for(int i=0;i<26;i++)
{
	if(start[i]!=-1)
	{

	for(int j=i+1;j<26;j++)
	{
		if(start[j]!=-1)
		{
            if(start[j]>start[i] && start[j]<stop[i])
            count++;
		}

	}
}

}
if(count<=k)
out.println("NO");
else
out.println("YES");

	}
}
class Number
{
int a;
int b;
int c;
public Number(int x,int y,int z)
{
a=x;
b=y;
c=z;
}
}
class Ch1Comparator implements Comparator<Number>
{
public int compare(Number f1,Number f2)
{
if(f1.a==f2.a)
return 0;
if(f1.a<f2.a)
return -1;
return 1;
}
}
class Ch2Comparator implements Comparator<Number>
{
public int compare(Number f1,Number f2)
{
if(f1.b==f2.b)
return 0;
if(f1.b<f2.b)
return -1;
return 1;
}
}class Ch3Comparator implements Comparator<Number>
{
public int compare(Number f1,Number f2)
{
if(f1.c==f2.c)
return 0;
if(f1.c<f2.c)
return -1;
return 1;
}
}

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n  =scanner.nextInt();
		int m =scanner.nextInt();
		String string = scanner.next();
		char arr[] = string.toCharArray();
		Map<Character, Integer> map = new HashMap<>();
		Set<Character> set = new HashSet<>();
		for(int i =0;i<arr.length;i++) {
			map.put(arr[i], i);
		}
		int used= 0;
		for(int i =0;i<arr.length;i++) {
			if (set.contains(arr[i])) {
				if (map.get(arr[i])==i) {
					used -- ;
				}
			}else {
				used++;
				set.add(arr[i]);
				if (used>m) {
					System.out.println("YES");
					return;
				}
			}
		}
		System.out.println("NO");
	}
}

import java.io.*;
import java.util.*;

public class Main
{
	static final int MOD = 1000000007;
	public static boolean test(int k, String s)
	{
	    Map<String, Integer> last = new HashMap<String, Integer>();
	    for(int i = 0; i < s.length(); i++)
	    {
	       last.put(s.substring(i,i+1),i);
	    }
	    Set<String> set = new HashSet<String>();
	    int count = 0;
	    for(int i = 0; i < s.length(); i++)
	    {
	        if(count > k)
	        {
	            return false;
	        }
	        if(!set.contains(s.substring(i,i+1)))
	        {
	            count++;
	            set.add(s.substring(i,i+1));
	        }
	        else if(last.get(s.substring(i,i+1)) == i)
	        {
	            count--;
	        }
	    }
	    return true;
	}
	public static void main(String[] args) throws IOException
	{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k =  sc.nextInt();
        String s  = sc.next();
        if(test(k,s))
        {
            System.out.println("NO");
        }
        else
        {
            System.out.println("YES");
        }
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class TheFestivalEvening {

	public static void main(String[] args)
	{
		FastReader in = new FastReader();
		int guest = in.nextInt();
		int guard = in.nextInt();
		int[] open = new int[26];
		int[] close = new int[26];

		String str = in.next();
		for(int i = 1; i <= guest; i++)
		{
			char c = str.charAt(i-1);
			int n = ((int)c)-65;
			if(open[n] == 0)
			{
				open[n] = i;
			}
			close[n] = i;
		}
		for(int i = 1; i <= guest; i++)
		{
			if(contains(open,i))
			{
				guard--;
			}
			else if(contains(close,i))
			{
				guard++;
			}
			if(guard < 0)
			{
				System.out.println("YES");
				return;
			}
		}
		System.out.println("NO");
	}

	public static boolean contains(int[] arr, int n)
	{
		for(int i : arr)
		{
			if(i==n)
				return true;
		}
		return false;
	}

	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Liavontsi Brechka
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static
    @SuppressWarnings("Duplicates")
    class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            String queue = in.next();

            int[] open = new int[26];
            int[] close = new int[26];
            Arrays.fill(open, -1);
            Arrays.fill(close, -1);

            char next;
            for (int i = 0; i < n; i++) {
                next = queue.charAt(i);
                if (open[next - 'A'] == -1) open[next - 'A'] = i;
                close[next - 'A'] = i;
            }

            int numberOpened = 0;
            for (int i = 0; i < n; i++) {
                next = queue.charAt(i);
                if (open[next - 'A'] == i) numberOpened++;
                else if (close[next - 'A'] == i) numberOpened--;

                if (numberOpened > k) {
                    out.print("YES");
                    return;
                }
            }

            out.print("NO");
        }

    }

    static class InputReader {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(readLine());
            }
            return tokenizer.nextToken();
        }

        public String readLine() {
            String line;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

    }
}

import java.io.*;
import java.util.*;
import java.math.*;

/**
 *
 * @author ghost
 */
public class B {

    public static void main(String args[])
    {

        //File file= new File("COMPLETE_FILE_PATH");
        //InputStream is = new FileInputStream(file);

        //InputReader in = new InputReader(is);
        InputReader in = new InputReader(System.in);
        PrintWriter out= new PrintWriter(System.out);

        int t=1;

        Task solver=new Task();
        solver.solve(t,in,out);

        out.flush();
        out.close();

    }

    static class Task {
        long mod = 1000000007;

        public void solve(int testNumber, InputReader in,PrintWriter out){

            int n=in.nextInt();int  k=in.nextInt();

            char[] guest=new char[n];
            guest=in.next().toCharArray();

            int[][] timing=new int[26][2];
            for(int i=0;i<26;i++){
                timing[i][1]=Integer.MIN_VALUE;
                timing[i][0]=Integer.MAX_VALUE;
           }

            for(int i=0;i<guest.length;i++){
                if(timing[guest[i]-'A'][0]>i)  timing[guest[i]-'A'][0]=i;
                if(timing[guest[i]-'A'][1]<i)  timing[guest[i]-'A'][1]=i;
            }

//            for(int i=0;i<26;i++){
//                for(int j=0;j<26;j++){
//                    out.print(timing[i][j]+" ");
//                }
//                out.println();
//            }

            int count=1;
            int last=Integer.MIN_VALUE;
            for(int i=0;i<25;i++){
                if(timing[i][1]>timing[i+1][0])
                    count++;
                last=Math.min(timing[i][1], timing[i+1][1]);
            }
            out.println(k==count?"NO":"YES");
        }

        int LOG2(long item){
            int count=0;
            while(item>1){
                item>>=1;count++;
            }
            return count;
        }

        long gcd(long a, long b) {
            a = Math.abs(a);
            b = Math.abs(b);
            return BigInteger.valueOf(a).gcd(BigInteger.valueOf(b)).longValue();
        }
    }

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String next() {
            return readString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }

        private static void pa(Object... o) {
            System.out.println(Arrays.deepToString(o));
        }
    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;

public class FestiveEvening {
    Node[] arr = new Node[26];
    static class Node{
        int l = -1;
        int r = -1;
        boolean stat = false;
        Node(int l, int r){
            this.l = l;
            this.r = r;
        }
    }
    public void insert(int x, int i){
        if(arr[x]==null){
            Node n = new Node(i,i);
            arr[x] = n;
        }
        else{
            arr[x].r = i;
        }
    }
    public int checkActive(int day){
        int count = 0;
        for(int i=0; i<arr.length; i++){
            if(arr[i]!=null){
                if(arr[i].l==day) {
                    arr[i].stat = true;
                }
                if(arr[i].r==day){
                    arr[i].stat = false;
                }
                if(arr[i].stat==true){
                    count++;
                }
            }
        }
        return count;
    }
    public static void main(String[] args) throws IOException{
        Reader.init(System.in);
        int n = Reader.nextInt();
        int k = Reader.nextInt();
        FestiveEvening h = new FestiveEvening();
        String s = Reader.next();
        for(int i=0; i<n; i++){
            char c = s.charAt(i);
            int x = (int)c - 65;
            h.insert(x,i);
        }
        int activeCount = 0;
        int sg = 0;
        for(int i=0; i<n; i++){
            activeCount = h.checkActive(i);
            if(activeCount>k){
                sg = 1;
            }
        }
        if(sg==1){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }
    }
}
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }

    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Collections;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ankur
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        sdavh solver = new sdavh();
        solver.solve(1, in, out);
        out.close();
    }

    static class sdavh {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            String str = in.readString();

            // System.out.println((int)'A');
            int ar[] = new int[26];
            int ar2[] = new int[26];
            for (int i = 0; i < 26; i++) {
                ar[i] = -1;
                ar2[i] = (int) 1e7;
            }
            for (int i = 0; i < str.length(); i++) {
                ar[str.charAt(i) - 'A'] = Math.max(i + 1, ar[str.charAt(i) - 'A']);
            }
            for (int i = 0; i < str.length(); i++) {
                ar2[str.charAt(i) - 'A'] = Math.min(i + 1, ar2[str.charAt(i) - 'A']);
            }

            ArrayList<pair> ans = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                if (ar[i] != -1) {
                    pair temp = new pair();
                    temp.s = 1;
                    temp.time = ar[i];
                    ans.add(temp);
                }
                if (ar2[i] < 1e7) {
                    pair temp = new pair();
                    temp.s = 0;
                    temp.time = ar2[i];
                    ans.add(temp);
                }
            }
            Collections.sort(ans);
            int max = -1;
            int ct = 0;
            for (int i = 0; i < ans.size(); i++) {
                if (ans.get(i).s == 0) {
                    ct++;
                } else
                    ct--;
                max = Math.max(max, ct);
            }
            //out.print(ans.size());
            // out.print(max);
            if (k < max) {
                out.print("NO");
            } else {
                out.print("YES");
            }

        }

        class pair implements Comparable<pair> {
            int s;
            int time;

            public String toString() {
                return s + " " + time + " ";
            }

            public int compareTo(pair o) {
                if (this.time == o.time) {
                    return -this.s + o.s;
                } else
                    return this.time - o.time;
            }

        }

    }

    static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar;
        private int snumChars;

        public InputReader(InputStream st) {
            this.stream = st;
        }

        public int read() {
            //*-*------clare------

            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }

}

import java.util.*;
public class E
{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int a[] = new int[26];
        int n = sc.nextInt();
        int k = sc.nextInt();
        Set<Integer> set = new HashSet<Integer>();
        String s = sc.next();
        int cnt = 1;
        boolean flag = true;
        for(int i=0;i<n;++i)
        {
            a[s.charAt(i)-'A'] += 1;
        }
        set.add((int)s.charAt(0));
        a[s.charAt(0)-'A'] -= 1;
        for(int i=1;i<n;++i)
        {
            for(int j=0;j<26;j++)
            {
                if(a[j]==0&&set.contains(j+(int)'A'))
                    set.remove(j+(int)'A');
            }
            if(set.size()>k)
            {
                System.out.println("YES");
                flag = false;
                break;
            }
            if(!set.contains(s.charAt(i)))
                set.add((int)s.charAt(i));
            a[s.charAt(i)-'A'] -= 1;
        }
        if(flag)
            System.out.println("NO");
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author AEroui
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();

            char[] arr = in.next().toCharArray();
            int[] e = new int[26];
            Arrays.fill(e, Integer.MAX_VALUE);
            int[] s = new int[26];
            Arrays.fill(s, Integer.MIN_VALUE);

            for (int i = 0; i < arr.length; ++i) {
                char c = arr[i];
                e[c - 'A'] = Math.min(e[c - 'A'], i);
                s[c - 'A'] = Math.max(e[c - 'A'], i);
            }

            int cnt = 0;
            boolean[] bb = new boolean[26];
            for (int i = 0; i < 26; ++i) {
                for (int j = i + 1; j < 26; ++j) {
                    if (s[j] < e[i]) continue;
                    if (s[i] < e[j]) continue;
                    if (bb[i] && bb[j]) {
                        continue;
                    }

                    bb[i] = bb[j] = true;
                    ++cnt;
                }
            }

            ++cnt;
            //out.println(cnt);
            out.println(cnt <= k ? "NO" : "YES");

        }

    }
}

import java.util.*;
public class theFestiveEvening {
        public static String gaurdsRequired(String g,int k) {
                int discontinuity=0;
                int distinct=0;
                for(int i=0; i<g.length()-1; i++) {
                        if(g.charAt(i)!=g.charAt(i+1)) discontinuity++;
                }
                HashSet<Character> h = new HashSet<Character>();
                for(int i=0;i<g.length();i++) {
                        h.add(g.charAt(i));
                }
                distinct=h.size();
                int res= discontinuity < distinct ? discontinuity : distinct;
                if(distinct == g.length()) {
                        res = distinct;
                }
                if(res <= k || res==g.length()) {
                        return "NO";
                }
                else
                        return "YES";
        }
        public static void main(String[] args) {
                Scanner input = new Scanner(System.in);
                String[] nk = input.nextLine().split(" ");
                int n = Integer.parseInt(nk[0]);
                int k = Integer.parseInt(nk[1]);
                String g = input.nextLine();
                String res = gaurdsRequired(g, k);
                System.out.println(res);
        }
}

import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		//DisjointSet set = new DisjointSet(26);

		InputReader sc1 = new InputReader(System.in);
		PrintWriter sc2 = new PrintWriter(System.out);
		int n = sc1.nextInt();
		int k = sc1.nextInt();
		String s = sc1.readString();
		int c[] = new int[26];
		Arrays.fill(c, 0);
		boolean visited[] = new boolean[26];
		Arrays.fill(visited, false);
		for(int i=0;i<s.length();i++) {
			c[s.charAt(i)-'0']++;
		}
		int alert = 0;
		for(int i=0;i<s.length();i++) {
			c[s.charAt(i)-'0']--;
			if(c[s.charAt(i)-'0']==0) {
				visited[s.charAt(i)-'0']= false;
				continue;
			}
			if(!visited[s.charAt(i)-'0']) {
				visited[s.charAt(i)-'0'] = true;
				alert = count(visited);
				if(alert>k) {
					System.out.println("NO");
					return;
				}
			}
		}
		sc2.println("YES");

		sc2.close();
	}
	public static int count(boolean a[]) {
		int count = 0;
		for(int i=0;i<26;i++) {
			if(a[i]==true) {
				count++;
			}
		}
		return count;
	}
	/*
	 * 	DIVISORS
	 * */
	public static void divsors(int n) {
		for(int i=1;i<=Math.sqrt(n)+1;i++) {
			if(n%i==0) {
				if(n/i==i) {
					System.out.print(i+" ");
				}
				else {
					System.out.print	(i+" "+n/i);
				}
			}
		}
	}

	/*
	 * 	GCD
	 * */

	public static int GCD(int x, int y) {
		if(x==0) {
			return y;
		}
		return GCD(y%x, x);
	}

	/*
	 * 	GCD EXTENDED
	 * */

	public static int gcdExtended(int a, int b, int x, int y) {
		if(a==0) {
			x = 0;
			y = 1;
			return b;
		}

		int x1 = 1, y1 = 1;
		int gcd = gcdExtended(b%a, a, x1, y1);
		x = y1 - (b/a)*x1;
		y = x1;

		return gcd;
	}

	static class DisjointSet{
		static StringBuilder str = new StringBuilder();
		static int count = 0;
		int rank[];
		int parent[];
		int n;
		DisjointSet(int n){
			this.n = n;
			rank = new int[n];
			Arrays.fill(rank, 0);
			parent = new int[n];
			makeSet();

		}
		void makeSet() {
			for(int i=0;i<n;i++) {
				parent[i] = i;
			}
		}

		int find(int x) {
			if(parent[x]!=x) {
				parent[x] = find(parent[x]);
			}
			return parent[x];
		}

		void union(int x, int y) {
			int xRoot = find(x);
			int yRoot = find(y);

			if(xRoot==yRoot) {
				return;
			}

			if(rank[xRoot]>rank[yRoot]) {
				parent[yRoot] = xRoot;
				Append(x,y);
				count++;
			}
			else if(rank[xRoot]<rank[yRoot]) {
				parent[xRoot] = yRoot;
				Append(x,y);
				count++;
			}
			else {
				parent[yRoot] = xRoot;
				rank[xRoot] = rank[xRoot] + 1;
				count++;
				Append(x,y);
			}
		}

		void Append(int x, int y) {
			str.append((char)(x+97)+" "+(char)(y+97)+"\n");
		}
	}
	static class InputReader {

		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public String readString() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}

import java.io.*;
import java.util.*;
import java.lang.*;
import static java.lang.System.*;
public class A
{
public static void main (String args[]) throws Exception
{
	Scanner sc=new Scanner(in);
	int n=sc.nextInt();
	int k=sc.nextInt();
	String s=sc.nextLine();
	s=sc.nextLine();
	int count=0;
	char arr[]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
    int brr[]=new int[n];
    for(int i=0;i<n;i++)
    {
		brr[i]=0;
	}
	for(int i=0;i<n;i++)
	{
		int pos=0;
		for(int j=0;j<26;j++)
		{
			if(s.charAt(i)==arr[j])
			pos=j;
		}
		brr[i]=pos+1;
	}
	int start[]=new int[26];
	int stop[]=new int[26];
    for(int i=0;i<26;i++)
    {
		start[i]=-1;
		stop[i]=-1;
	}
	for(int i=0;i<26;i++)
	{
		for(int j=0;j<n;j++)
		{
         if(brr[j]==i+1)
          {start[i]=j+1;break;}
		}
		for(int j=n-1;j>=0;j--)
				{
		         if(brr[j]==i+1)
		          {stop[i]=j+1;break;}
				}

	}
for(int i=0;i<n;i++)
{
	if(count>k)
	{
		out.println("YES");
		exit(0);
	}
	char ch=s.charAt(i);
	int pos=(int)(ch-65);
	if(start[pos]==i+1 && stop[pos]==i+1)
	{

	}
	else if(start[pos]==i+1)
	{
		count++;
	}
	else if (stop[pos]==i+1)
	{
		count--;
	}

}
out.println("NO");
	}
}
class Number
{
int a;
int b;
int c;
public Number(int x,int y,int z)
{
a=x;
b=y;
c=z;
}
}
class Ch1Comparator implements Comparator<Number>
{
public int compare(Number f1,Number f2)
{
if(f1.a==f2.a)
return 0;
if(f1.a<f2.a)
return -1;
return 1;
}
}
class Ch2Comparator implements Comparator<Number>
{
public int compare(Number f1,Number f2)
{
if(f1.b==f2.b)
return 0;
if(f1.b<f2.b)
return -1;
return 1;
}
}class Ch3Comparator implements Comparator<Number>
{
public int compare(Number f1,Number f2)
{
if(f1.c==f2.c)
return 0;
if(f1.c<f2.c)
return -1;
return 1;
}
}

import java.io.*;
import java.util.InputMismatchException;
public final class CR26_ProblemB
{
	private static class InputReader
    {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public int[] readIntArray(int n)
        {
        	int a[] = new int[n];
        	for(int i=0;i<n;i++)
        	{
        		a[i] = readInt();
        	}
        	return a;
        }

        public double[] readDoubleArray(int n)
        {
        	double a[] = new double[n];
        	for(int i=0;i<n;i++)
        	{
        		a[i] = readDouble();
        	}
        	return a;
        }

        public long[] readLongArray(int n)
        {
        	long a[] = new long[n];
        	for(int i=0;i<n;i++)
        	{
        		a[i] = readLong();
        	}
        	return a;
        }

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }

        public int read()
        {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars)
            {
                curChar = 0;
                try
                {
                    numChars = stream.read(buf);
                } catch (IOException e)
                {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int readInt()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String readString()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }
        public double readDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, readInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
        public long readLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
        public boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next()
        {
            return readString();
        }

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }

    public static void main(String[] args)
	{
		InputReader input = new InputReader(System.in);
//        int testCases = input.readInt();
//        while(testCases-->0)
        {
        	int n = input.readInt();
        	int k = input.readInt();
        	String s = input.readString();
        	int arr[] = new int[26];
        	int brr[] = new int[26];
        	for(int i=0;i<s.length();i++)
        	{
        		char c = s.charAt(i);
        		arr[c-'A']=i;
        	}
        	int open =0;
        	String result = "NO";
        	for(int i=0;i<s.length();i++)
        	{
        		char c = s.charAt(i);
        		if(brr[c-'A']==0)
        		{
        			brr[c-'A']=1;
        			open++;
        		}
        		else if(brr[c-'A']!=0 && arr[c-'A']>=i)
        		{
        			brr[c-'A']=0;
        			open--;
        		}
        		if(open>k)
        		{
        			result = "YES";
        			break;
        		}
        	}
        	System.out.println(result);
        }
	}
}

import java.util.*;
import java.io.*;

public class Codeforces827B {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());
		char[] lst = new char[n];
		st = new StringTokenizer(br.readLine());
		String s = st.nextToken();
		for (int i = 0; i < n; i++) {
			lst[i] = s.charAt(i);
		}

		int[] start = new int[26];
		int[] end = new int[26];
		for (int i = 1; i < 26; i++) {
			start[i] = -1;
			end[i] = -1;
		}

		for (int i = 1; i < n; i++) {
			int val = (int) lst[i] - 65;
			if (start[val] < 0) {
				start[val] = i;
			}
			end[val] = i;
		}

		boolean ans = true;

		for (int i = 0; i < n; i++) {
			int num = 0;
			for (int j = 0; j < 26; j++) {
				if ((start[j] <= i) && (end[j] >= i))
					num++;
			}
			if (num > k) {
				ans = false;
			}
		}

		if (ans)
			System.out.println("YES");
		else
			System.out.println("NO");

	}
}

import java.util.Arrays;
import java.util.Scanner;

public class Guard {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int inputSize = scn.nextInt();
		int guards = scn.nextInt();
		String str = scn.next();

		int[] start = new int[26];
		Arrays.fill(start, -1);

		int[] end = new int[26];
		Arrays.fill(end, -1);

		for (int i = 0; i < str.length(); i++) {
			int a = (int) str.charAt(i) - (int) 'A';
			if (start[a] == -1) {
				start[a] = i;
			} else {
				end[a] = i;
			}
		}

		for (int i = 0; i < 25; i++) {
			if (start[i] != -1 && end[i] == -1) {
				end[i] = start[i];
			}
		}

		int max = 0;
		int count = 0;
		int plat_needed = 0, result = 1;
		int i = 1, j = 0;
		int n = 26;
		// Similar to merge in merge sort to process
		// all events in sorted order
		while (i < n && j < n && start[i] != -1) {
			// If next event in sorted order is arrival,
			// increment count of platforms needed
			if (start[i] <= end[j]) {
				plat_needed++;
				i++;

				// Update result if needed
				if (plat_needed > result)
					result = plat_needed;
			}

			// Else decrement count of platforms needed
			else {
				plat_needed--;
				j++;
			}
		}
		if (guards < result) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

		scn.close();
	}
}

import java.io.*;
import java.util.*;

public class Main {
    private void solve() {
        int n = nextInt();
        int k = nextInt();
        char s[] = next().toCharArray();
        boolean a[] = new boolean[26];
        int b[] = new int[26];
        Arrays.fill(a,false);
        Arrays.fill(b,0);
        b[0]=1;
        int security=1;
        for (int i = 0; i < n; i++) {
            if(i!=0 && s[i]!=s[i-1] && a[s[i]-65] && b[s[i]-65]==0){
                security++;
                b[s[i]-65]=1;
            }
                a[s[i]-65]=true;
        }
        out.print((security <= k ? "Yes" : "No")+" alo "+security);
    }
    public static void main(String[] args) {
        new Main().run();
    }

    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;

    private void run() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            //br = new BufferedReader(new FileReader("birthday.in"));
            //out = new PrintWriter(new FileWriter("birthday.out"));
            solve();
            br.close();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private int nextInt() {
        return Integer.parseInt(next());
    }

    private String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
                return "END_OF_FILE";
            }
        }
        return st.nextToken();
    }
}

import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	private static FastScanner sc = new FastScanner();

	public static void main(String[] args) {
		int n = sc.nextInt();
		int k = sc.nextInt();
		char[] str = sc.next().toCharArray();

		int[] open = new int[n];

		boolean[] checked = new boolean[26];
		int cnt = 0;
		for(int i=0; i<n; i++) {
			if(!checked[str[i] - 'A']) {
				checked[str[i] - 'A'] = true;
				open[i]++;
				cnt++;
			}
			if(cnt == 26) break;
		}

		checked = new boolean[26];
		cnt = 0;
		for(int i=n-2; i>=0; i--) {
			if(!checked[str[i] - 'A']) {
				checked[str[i] - 'A'] = true;
				open[i+1]--;
				cnt++;
			}
			if(cnt == 26) break;
		}

		for(int i=1; i<n; i++) {
			open[i] += open[i-1];
		}

		for(int i=1; i<n; i++) {
			if(open[i] > k) {
				System.out.println("YES");
				return;
			}
		}

		System.out.println("NO");

	}

	static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Solution{
    public static void main(String[] args){
        try{
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            String[] ss=br.readLine().split(" ");
            int n=Integer.parseInt(ss[0]);
            int k=Integer.parseInt(ss[1]);
            String s=br.readLine();
            HashMap<Character,int[]> map=new HashMap<>();
            for(int i=0;i<s.length();i++){
                if(map.containsKey(s.charAt(i))){
                    int[] aa=map.get(s.charAt(i));
                    aa[1]=i;
                }else{
                    int[] aa=new int[2];
                    aa[0]=i;
                    aa[1]=i;
                    map.put(s.charAt(i),aa);
                }
            }
            Iterator it=map.entrySet().iterator();
            ArrayList<pair> list=new ArrayList<>();
            while(it.hasNext()){
                Map.Entry element=(Map.Entry)it.next();
                int[] val=(int[])element.getValue();
                pair p=new pair(val[0],val[1]);
                list.add(p);
            }
            Collections.sort(list, new Comparator<pair>() {
                @Override
                public int compare(pair p1, pair p2) {
                    if(p1.a>p2.a){
                        return 1;
                    }else if(p1.a<p2.a){
                        return -1;
                    }else{
                        return 0;
                    }
                }
            });
            int max=1,c=1;
            for(int i=1;i<list.size();i++){
                //System.out.println(list.get(i).a+" "+list.get(i).b);
                if(list.get(i).a<list.get(i-1).b){
                    c++;
                }else{
                    c=1;
                }
                max=Math.max(max,c);
            }
            if(max>k){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }catch(Exception e){
            System.out.println("kkkk");
        }
    }
    static class pair{
        int a,b;
        public pair(int a,int b){
            this.a=a;
            this.b=b;
        }
    }
}

import java.util.Scanner;

/**
 * Created by texnoman on 30.07.17.
 */
public class Main {
    public static void main(String[] args){
        String line;
        String[] lines;
        String doors;
        char[] symbol;
        int[] symbolfinal;

        Scanner scan=new Scanner(System.in);

        line=scan.nextLine();
        lines= line.split(" ");

        doors=scan.nextLine();
        symbol=doors.toCharArray();
        symbolfinal=new int[symbol.length];

        for(int i=0;i<symbol.length;i++) {
            symbolfinal[i]=Character.getNumericValue(symbol[i])-10;
            System.out.println(symbolfinal[i]);
        }

        String resulttest=schet(Integer.parseInt(lines[0]),Integer.parseInt(lines[1]),symbolfinal);
    }

    public static String schet(int guestcount, int secourity, int[] door){
        int[] schetrazn= new int[26];
        boolean[] opendoors= new boolean[26];
        int opendoorcount=0;

        for(int i=0;i<26;i++) schetrazn[i]=0;
        for(int i=0;i<26;i++) opendoors[i]=false;
        int numberdoor;
        int opendoorcountmax=0;
        for(int i=0;i<guestcount;i++){
            numberdoor=door[i];
            schetrazn[numberdoor]=i;
        }
        /*
        **Счет
         */
        String result="NO";
        for(int i=0;i<guestcount;i++){
            numberdoor=door[i];
            if (!opendoors[numberdoor]) {
                opendoorcount++;
                opendoors[numberdoor] = true;
            }
            if(opendoorcount>secourity) {
                result= "YES";
                break;
            }
            if(schetrazn[numberdoor]==i) {
                opendoorcount--;
                opendoors[numberdoor]=false;
            }

        }
        return result;
        }

    }

import java.awt.geom.Point2D;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;

public class Main {
  final static int INF = 1 << 28;
  final static long LNF = 1L << 60;
  final static long MOD = 1_000_000_007;
  final static double EPS = 1e-9;
  final static double GOLDEN_RATIO = (1.0 + Math.sqrt(5)) / 2.0;
  Scanner sc = new Scanner(System.in);

  public static void main(String[] args) {
    new Main().run();
  }

  void run() {
    int[] left = new int[256];
    int[] right = new int[256];
    for (int i = 'A'; i <= 'Z'; ++i) {
      left[i] = right[i] = -1;
    }
    int n = ni();
    int k = ni();
    String str = sc.next();
    for (int i = 0; i < n; ++i) {
      char c = str.charAt(i);
      if (left[c] == -1) {
        left[c] = i;
        right[c] = i;
      } else {
        right[c] = i;
      }
    }
    int[] imos = new int[2000000];
    for (int i = 'A'; i <= 'Z'; ++i) {
      if (left[i] == -1) {
        continue;
      }
      imos[left[i]]++;
      imos[right[i] + 1]--;
    }
    int max = 0;
    int acc = 0;
    for (int i = 0; i < 2000000; ++i) {
      acc += imos[i];
      max = Math.max(max, acc);
    }
    System.out.println(max);
    if (max > k) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  }

  int ni() {
    return Integer.parseInt(sc.next());
  }

  long nl() {
    return sc.nextLong();
  }

  double nd() {
    return Double.parseDouble(sc.next());
  }

  void debug(Object... os) {
    System.err.println(Arrays.deepToString(os));
  }

  /**
   * ユークリッドの互除法
   *
   * @return a と b の最大公約数
   */
  long gcd(long a, long b) {
    if (b == 0) {
      return a;
    }
    return gcd(b, a % b);
  }

  /**
   * 拡張ユークリッドの互除法
   *
   * @return mx + ny = gcd(m, n)となるような(x, y)を返す
   */
  Pair<Long, Long> gcd_ex(long m, long n) {
    long[][] mat = _gcd_ex(m, n);
    return new Pair<>(mat[0][0], mat[0][1]);
  }

  long[][] _gcd_ex(long m, long n) {
    if (n == 0) {
      return new long[][]{{1, 0}, {0, 1}};
    }
    long k = m / n;
    long[][] K = new long[][]{{0, 1}, {1, -k}};
    long[][] r = _gcd_ex(n, m % n);
    long[][] dst = new long[2][2];
    for (int y = 0; y < 2; ++y)
      for (int x = 0; x < 2; ++x)
        for (int i = 0; i < 2; ++i)
          dst[y][x] += r[y][i] * K[i][x];
    return dst;
  }

  /**
   * 繰り返し2乗法を用いたべき乗の実装
   *
   * @return a^r (mod 1,000,000,007)
   */
  long pow(long a, long r) {
    long sum = 1;
    while (r > 0) {
      if ((r & 1) == 1) {
        sum *= a;
        sum %= MOD;
      }
      a *= a;
      a %= MOD;
      r >>= 1;
    }
    return sum;
  }

  /**
   * 組み合わせ
   * O(n)
   *
   * @return {}_nC_r
   */
  long C(int n, int r) {
    long sum = 1;
    for (int i = n; 0 < i; --i) {
      sum *= i;
      sum %= MOD;
    }
    long s = 1;
    for (int i = r; 0 < i; --i) {
      s *= i;
      s %= MOD;
    }
    sum *= pow(s, MOD - 2);
    sum %= MOD;

    long t = 1;
    for (int i = n - r; 0 < i; --i) {
      t *= i;
      t %= MOD;
    }
    sum *= pow(t, MOD - 2);
    sum %= MOD;

    return sum;
  }

  /**
   * 黄金分割探索
   *
   * @param left  下限
   * @param right 上限
   * @param f     探索する関数
   * @param comp  上に凸な関数を探索するときは、Comparator.comparingDouble(Double::doubleValue)
   *              下に凸な関数を探索するときは、Comparator.comparingDouble(Double::doubleValue).reversed()
   * @return 極値の座標x
   */
  double goldenSectionSearch(double left, double right, Function<Double, Double> f, Comparator<Double> comp) {
    double c1 = divideInternally(left, right, 1, GOLDEN_RATIO);
    double c2 = divideInternally(left, right, GOLDEN_RATIO, 1);
    double d1 = f.apply(c1);
    double d2 = f.apply(c2);
    while (right - left > 1e-9) {
      if (comp.compare(d1, d2) > 0) {
        right = c2;
        c2 = c1;
        d2 = d1;
        c1 = divideInternally(left, right, 1, GOLDEN_RATIO);
        d1 = f.apply(c1);
      } else {
        left = c1;
        c1 = c2;
        d1 = d2;
        c2 = divideInternally(left, right, GOLDEN_RATIO, 1);
        d2 = f.apply(c2);
      }
    }
    return right;
  }

  /**
   * [a,b]をm:nに内分する点を返す
   */
  double divideInternally(double a, double b, double m, double n) {
    return (n * a + m * b) / (m + n);
  }

  /**
   * http://alexbowe.com/popcount-permutations/
   * bitの立っている数が小さい順にループしたいときに使う。
   * ex)
   * <pre>
   * for (int i = 0; i < 25; ++i) {
   *   int bits = (1 << i) - 1;
   *   long m = C(25, num);
   *   for (j = 0; j < m; ++j) {
   *     ...(25個の中からi個bitが立っている)
   *     if (bits != 0)
   *       bits = next_perm(bits);
   *   }
   * }
   * </pre>
   *
   * @param v 現在のbit列
   * @return 次のbit列
   */
  int next_perm(int v) {
    int t = (v | (v - 1)) + 1;
    return t | ((((t & -t) / (v & -v)) >> 1) - 1);
  }

  static class Util {
    static <T extends Comparable<T>> T max(T a, T b) {
      if (a.compareTo(b) > 0) {
        return a;
      } else {
        return b;
      }
    }

    static <T extends Comparable<T>> T min(T a, T b) {
      if (a.compareTo(b) < 0) {
        return a;
      } else {
        return b;
      }
    }
  }

  /**
   * from http://gihyo.jp/dev/serial/01/geometry part 6
   */
  static class Line {
    double a;
    double b;
    double c;

    /**
     * 一般形のパラメータから直線を作成する
     *
     * @param a xの係数
     * @param b yの係数
     * @param c 定数項
     */
    Line(double a, double b, double c) {
      this.a = a;
      this.b = b;
      this.c = c;
    }

    /**
     * 2点(x1, y1), (x2, y2)を通る直線を作成する
     *
     * @param x1 1点目のx座標
     * @param y1 1点目のy座標
     * @param x2 2点目のx座標
     * @param y2 2点目のy座標
     * @return 直線
     */
    static Line fromPoints(double x1, double y1, double x2, double y2) {
      double dx = x2 - x1;
      double dy = y2 - y1;
      return new Line(dy, -dx, dx * y1 - dy * x1);
    }

    /**
     * 与えられた直線との交点を返す
     *
     * @param l 直線
     * @return 交点。2直線が平行の場合はnull
     */
    Point2D getIntersectionPoint(Line l) {
      double d = a * l.b - l.a * b;
      if (d == 0.0) {
        return null;
      }
      double x = (b * l.c - l.b * c) / d;
      double y = (l.a * c - a * l.c) / d;
      return new Point2D.Double(x, y);
    }

    @Override
    public String toString() {
      return "a = " + a + ", b = " + b + ", c = " + c;
    }
  }

  static class Line1D {
    int x1;
    int x2;

    // [x1, x2) : 半開空間
    Line1D(int x1, int x2) {
      this.x1 = x1;
      this.x2 = x2;
    }

    boolean isCross(Line1D l) {
      return isCross(l.x1, l.x2);
    }

    boolean isCross(int y1, int y2) {
//      boolean ret = x1 < y2 && y1 < x2;
//      assert ret == new LineSegment(x1, 0, x2, 0).intersects(new LineSegment(y1, 0, y2, 0));
//      return ret;
      return new LineSegment(x1 - 0.25, 0, x2 + 0.25, 0).intersects(new LineSegment(y1 - 0.25, 0, y2 + 0.25, 0));
    }
  }

  /**
   * from http://gihyo.jp/dev/serial/01/geometry part 6
   */
  static public class LineSegment {
    double x1;
    double y1;
    double x2;
    double y2;

    LineSegment(double x1, double y1, double x2, double y2) {
      this.x1 = x1;
      this.y1 = y1;
      this.x2 = x2;
      this.y2 = y2;
    }

    Line toLine() {
      return Line.fromPoints(x1, y1, x2, y2);
    }

    boolean intersects(Line l) {
      double t1 = l.a * x1 + l.b * y1 + l.c;
      double t2 = l.a * x2 + l.b * y2 + l.c;
      return t1 * t2 <= 0;
    }

    boolean intersects(LineSegment s) {
      return bothSides(s) && s.bothSides(this);
    }

    // sが自線分の「両側」にあるかどうかを調べる
    private boolean bothSides(LineSegment s) {
      double ccw1 = GeomUtils.ccw(x1, y1, s.x1, s.y1, x2, y2);
      double ccw2 = GeomUtils.ccw(x1, y1, s.x2, s.y2, x2, y2);
      if (ccw1 == 0 && ccw2 == 0) { // sと自線分が一直線上にある場合
        // sのいずれか1つの端点が自線分を内分していれば、sは自線分と共有部分を持つので
        // trueを返す
        return internal(s.x1, s.y1) || internal(s.x2, s.y2);
      } else { // それ以外の場合
        // CCW値の符号が異なる場合にtrueを返す
        return ccw1 * ccw2 <= 0;
      }
    }

    // (x, y)が自線分を内分しているかどうかを調べる
    private boolean internal(double x, double y) {
      // (x, y)から端点に向かうベクトルの内積がゼロ以下であれば内分と見なす
      return GeomUtils.dot(x1 - x, y1 - y, x2 - x, y2 - y) <= 0;
    }

    public Point2D getIntersectionPoint(Line l) {
      if (!intersects(l)) {
        return null; // 交差しない場合はnullを返す
      }
      return l.getIntersectionPoint(toLine());
    }

    public Point2D getIntersectionPoint(LineSegment s) {
      if (!intersects(s)) {
        return null; // 交差しない場合はnullを返す
      }
      return s.toLine().getIntersectionPoint(toLine());
    }

    /**
     * from : http://www.deqnotes.net/acmicpc/2d_geometry/lines#distance_between_line_segment_and_point
     */
    double distance(double x0, double y0) {
      // 端点チェック
      if (GeomUtils.dot(x2 - x1, y2 - y1, x0 - x1, y0 - y1) < EPS) {
        return GeomUtils.abs(x0 - x1, y0 - y1);
      }
      if (GeomUtils.dot(x1 - x2, y1 - y2, x0 - x2, y0 - y2) < EPS) {
        return GeomUtils.abs(x0 - x2, y0 - y2);
      }
      // 直線と点の距離
      return Math.abs(GeomUtils.cross(x2 - x1, y2 - y1, x0 - x1, y0 - y1)) / GeomUtils.abs(x2 - x1, y2 - y1);
    }

    double distance(LineSegment l) {
      if (this.intersects(l)) {
        return 0.0;
      }
      double min = Double.MAX_VALUE;
      min = Math.min(min, distance(l.x1, l.y1));
      min = Math.min(min, distance(l.x2, l.y2));
      min = Math.min(min, l.distance(x1, y1));
      min = Math.min(min, l.distance(x2, y2));
      return min;
    }

    @Override
    public String toString() {
      return "(" + x1 + ", " + y1 + ") - (" + x2 + ", " + y2 + ")";
    }
  }

  /**
   * from http://gihyo.jp/dev/serial/01/geometry part 6
   */
  static class GeomUtils {
    // 外積
    static double cross(double x1, double y1, double x2, double y2) {
      return x1 * y2 - x2 * y1;
    }

    // 内積
    static double dot(double x1, double y1, double x2, double y2) {
      return x1 * x2 + y1 * y2;
    }

    // (x1, y1) -> (x2, y2) -> (x3, y3) と進む道のりが半時計回りの場合は正の値、
    // 時計回りの場合は負の値、一直線上の場合はゼロを返す
    static double ccw(double x1, double y1, double x2, double y2,
                      double x3, double y3) {
      return cross(x2 - x1, y2 - y1, x3 - x2, y3 - y2);
    }

    static double ccw(Point2D p1, Point2D p2, Point2D p3) {
      return ccw(p1.getX(), p1.getY(), p2.getX(), p2.getY(), p3.getX(), p3.getY());
    }

    // ベクトルの長さ
    static double abs(double x, double y) {
      return Math.sqrt(x * x + y * y);
    }

    // 多角形の内外判定
    // http://www.nttpc.co.jp/technology/number_algorithm.html
    // 模擬国内2017EでWAになった
    // 凸多角形 -> 右周りでccwが全部負
    // 凹多角形含む単純な多角形 -> 点から無限に右に伸ばした線分との交点が1つ
    static boolean isIn(ArrayList<LineSegment> list, double x, double y) {
      int wn = 0;
      for (LineSegment l : list) {
        if (l.y1 <= y && l.y2 > y) {
          double vt = (y - l.y1) / (l.y2 - l.y1);
          if (x < l.x1 + (vt * (l.x2 - l.x1))) {
            ++wn;
          }
        }
        if (l.y1 > y && l.y2 <= y) {
          double vt = (y - l.y1) / (l.y2 - l.y1);
          if (x < (l.x1 + (vt * (l.x2 - l.x1)))) {
            --wn;
          }
        }
      }
      return wn > 0;
    }
  }

  /**
   * http://qiita.com/p_shiki37/items/65c18f88f4d24b2c528b
   */
  static class FastScanner {
    private final InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    public FastScanner(InputStream in) {
      this.in = in;
    }

    private static boolean isPrintableChar(int c) {
      return 33 <= c && c <= 126;
    }

    private boolean hasNextByte() {
      if (ptr < buflen) {
        return true;
      } else {
        ptr = 0;
        try {
          buflen = in.read(buffer);
        } catch (IOException e) {
          e.printStackTrace();
        }
        if (buflen <= 0) {
          return false;
        }
      }
      return true;
    }

    private int readByte() {
      if (hasNextByte()) return buffer[ptr++];
      else return -1;
    }

    private void skipUnprintable() {
      while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
    }

    public boolean hasNext() {
      skipUnprintable();
      return hasNextByte();
    }

    public String next() {
      if (!hasNext()) throw new NoSuchElementException();
      StringBuilder sb = new StringBuilder();
      int b = readByte();
      while (isPrintableChar(b)) {
        sb.appendCodePoint(b);
        b = readByte();
      }
      return sb.toString();
    }

    public long nextLong() {
      if (!hasNext()) throw new NoSuchElementException();
      long n = 0;
      boolean minus = false;
      int b = readByte();
      if (b == '-') {
        minus = true;
        b = readByte();
      }
      if (b < '0' || '9' < b) {
        throw new NumberFormatException();
      }
      while (true) {
        if ('0' <= b && b <= '9') {
          n *= 10;
          n += b - '0';
        } else if (b == -1 || !isPrintableChar(b)) {
          return minus ? -n : n;
        } else {
          throw new NumberFormatException();
        }
        b = readByte();
      }
    }
  }

  static class Pair<F extends Comparable<F>, S extends Comparable<S>> implements Comparable<Pair<F, S>> {
    F f;
    S s;

    Pair() {
    }

    Pair(F f, S s) {
      this.f = f;
      this.s = s;
    }

    Pair(Pair<F, S> p) {
      f = p.f;
      s = p.s;
    }

    @Override
    public int compareTo(Pair<F, S> p) {
      if (f.compareTo(p.f) != 0) {
        return f.compareTo(p.f);
      }
      return s.compareTo(p.s);
    }

    @Override
    public int hashCode() {
      return f.hashCode() ^ s.hashCode();
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || this.f == null || this.s == null) {
        return false;
      }
      if (this.getClass() != o.getClass()) {
        return false;
      }
      Pair p = (Pair) o;
      return this.f.equals(p.f) && this.s.equals(p.s);
    }

    @Override
    public String toString() {
      return "{" + f.toString() + ", " + s.toString() + "}";
    }
  }

  class BIT<T> {
    int n;
    ArrayList<T> bit;
    BiFunction<T, T, T> bif;

    /**
     * 1-indexed なBinary Indexed Treeを構築する
     *
     * @param n   容量
     * @param bif 適用させる関数
     * @param sup 初期値
     */
    BIT(int n, BiFunction<T, T, T> bif, Supplier<T> sup) {
      this.n = n;
      bit = new ArrayList<>(n + 1);
      for (int i = 0; i < n + 1; ++i) {
        bit.add(sup.get());
      }
      this.bif = bif;
    }

    /**
     * iの位置の値をvで更新する
     *
     * @param i index
     * @param v 新しい値
     */
    void set(int i, T v) {
      for (int x = i; x <= n; x += x & -x) {
        bit.set(x, bif.apply(bit.get(x), v));
      }
    }

    /**
     * クエリー
     *
     * @param defaultValue 初期値
     * @param i            index
     * @return [1, i]までfを適用した結果
     */
    T reduce(T defaultValue, int i) {
      T ret = defaultValue;
      for (int x = i; x > 0; x -= x & -x) {
        ret = bif.apply(ret, bit.get(x));
      }
      return ret;
    }
  }

  class SegmentTree<T> {
    int n;
    ArrayList<T> dat;
    BiFunction<T, T, T> bif;
    Supplier<T> sup;

    /**
     * 0-indexed なSegment Treeを構築する
     *
     * @param n_  要求容量
     * @param bif 適用させる関数
     * @param sup 初期値
     */
    SegmentTree(int n_, BiFunction<T, T, T> bif, Supplier<T> sup) {
      n = 1;
      while (n < n_) n *= 2;

      dat = new ArrayList<>(2 * n - 1);
      for (int i = 0; i < 2 * n - 1; ++i) {
        dat.add(sup.get());
      }
      this.bif = bif;
      this.sup = sup;
    }

    /**
     * kの位置の値をvで更新する
     *
     * @param k index
     * @param v 新しい値
     */
    void set(int k, T v) {
      k += n - 1;
      dat.set(k, v);
      while (k > 0) {
        k = (k - 1) / 2;
        dat.set(k, bif.apply(dat.get(k * 2 + 1), dat.get(k * 2 + 2)));
      }
    }

    /**
     * クエリー
     *
     * @param l はじめ
     * @param r おわり
     * @return [l, r)での演算bifを適用した結果を返す
     */
    T reduce(int l, int r) {
      return _reduce(l, r, 0, 0, n);
    }

    T _reduce(int a, int b, int k, int l, int r) {
      if (r <= a || b <= l) return sup.get();
      if (a <= l && r <= b) return dat.get(k);
      T vl = _reduce(a, b, k * 2 + 1, l, (l + r) / 2);
      T vr = _reduce(a, b, k * 2 + 2, (l + r) / 2, r);
      return bif.apply(vl, vr);
    }
  }

  class UnionFind {
    int[] par;

    UnionFind(int n) {
      par = new int[n];
      for (int i = 0; i < n; ++i) {
        par[i] = i;
      }
    }

    int find(int x) {
      if (par[x] == x) {
        return x;
      }
      return par[x] = find(par[x]);
    }

    boolean same(int x, int y) {
      return find(x) == find(y);
    }

    void union(int x, int y) {
      x = find(x);
      y = find(y);
      if (x == y) {
        return;
      }
      par[x] = y;
    }
  }
}

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		int n, m;
		String s;
		int[] arr = new int[26];
		Arrays.fill(arr, 0);
		Map<Character, Boolean> map = new HashMap<>();

		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		m = sc.nextInt();
		sc.nextLine();
		s = sc.nextLine();

		for(int i = 0;i < n;i++)
			arr[s.charAt(i) - 65]++;

		for(int i = 0;i < n;i++) {
			if(map.containsKey(s.charAt(i))) {
				if(arr[s.charAt(i) - 65] == 1)
					m++;
				else
					arr[s.charAt(i) - 65]--;
			} else {
				if(m > 0) {
					m--;
					arr[s.charAt(i) - 65]--;
					map.put(s.charAt(i), true);
				} else {
					System.out.println("NO");
					return;
				}
			}
		}
		System.out.println("YES");
	}

}

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n =scanner.nextInt();
		int m =scanner.nextInt();
		String string =scanner.next();
		char[] arr=  string.toCharArray();
		Map<Character, Integer> map = new HashMap<>();
		for (int i = 0; i < arr.length; i++) {
			map.put(arr[i], i);
		}
		Set<Character> set = new HashSet<>();
		int used =0;
		for(int i =0;i<arr.length;i++) {
			if (set.contains(arr[i])) {
				if (map.get(arr[i])==i) {
					used--;
				}
			}else {
				used++;
				if (used>m) {
					System.out.println("YES");
					return;
				}
			}
		}
		System.out.println("NO");

	}
}

/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
public class S {
	public static void main (String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int k=in.nextInt();
		String s=in.next();
		Map<Character,Integer> map=new HashMap<>();
		for(int i=0;i<n;i++)
		{
		    if(!map.containsKey(s.charAt(i)))map.put(s.charAt(i),1);
		    else map.put(s.charAt(i),map.get(s.charAt(i))+1);
		}
		if(map.size()<=k)System.out.print("NO");
		else
		{
		    Map<Character,Integer> temp=new HashMap<>();
		    int flag=0;
		    for(int i=0;i<n;i++)
		    {
		        if(!temp.containsKey(s.charAt(i)))temp.put(s.charAt(i),1);
		        else temp.put(s.charAt(i),temp.get(s.charAt(i))+1);

		        if(temp.get(s.charAt(i))==map.get(s.charAt(i)))
		        {
		            temp.remove(s.charAt(i));
		        }
		        if(temp.size()>k)
		        {
		            flag=1;
		            break;
		        }
		    }
		    if(flag==1)System.out.print("YES");
		    else System.out.print("NO");
		}
	}
}

import java.util.HashSet;
import java.util.Scanner;

public class Thefestuveevning {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);
		HashSet<Character> set = new HashSet<Character>();
		int n = input.nextInt();
		int a = input.nextInt();
		String s = input.next();
		int[] arr = new int[n];
		int[] brr = new int[n];
		for(int i=0; i<n;i++){
			if(!set.contains(s.charAt(i))){
				set.add(s.charAt(i));

				for(int j=i; j<n;j++)arr[j]++;
			}
		}
		for(int i=n-1;i>=0;i--){
			if(set.contains(s.charAt(i))){
				set.remove(s.charAt(i));
				for(int j=i+1; j<n;j++)arr[j]--;
			}
		}
		for(int i=0; i<n;i++)System.out.print(arr[i] + " ");
		System.out.println(set.size());
		for(int i=0; i<n;i++){
			if(arr[i]>a){
				System.out.println("YES");
				return;
			}
		}
		System.out.println("NO");

	}

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author AEroui
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();

            char[] arr = in.next().toCharArray();
            int[] e = new int[26];
            Arrays.fill(e, Integer.MAX_VALUE);
            int[] s = new int[26];
            Arrays.fill(s, Integer.MIN_VALUE);

            for (int i = 0; i < arr.length; ++i) {
                char c = arr[i];
                e[c - 'A'] = Math.min(e[c - 'A'], i);
                s[c - 'A'] = Math.max(e[c - 'A'], i);
            }

            int cur = 0;
            for (int i = 0; i < n; ++i) {
                if (e[arr[i] - 'A'] == i) ++cur;
                else if (s[arr[i] - 'A'] == i) --cur;

                if (cur > k) {
                    out.println("YES");
                    return;
                }
            }

            out.println("NO");

        }

    }
}

import java.io.*;
import java.util.*;

public class B {
	public static void main(String args[]) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int g = Integer.parseInt(st.nextToken());

		st = new StringTokenizer(br.readLine());
		char[] arr = (st.nextToken()).toCharArray();
		ArrayList<Character> arr2 = new ArrayList<Character>();
		for(char a : arr){
			arr2.add(a);
		}
		boolean[] bool = new boolean[26];
		Arrays.fill(bool, false);

		while(arr2.size() > 0){
			char index = arr2.remove(0);
			bool[index-65]=true;
			if(!arr2.contains(index)){
				bool[index-65]=false;
			}
			int cnt = 0;
			for(boolean boo : bool){
				if (boo){
					cnt++;
				}
			}
			if(cnt > g){
				System.out.println("YES");
				return;
			}
		}
		System.out.println("NO");

	}
}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package codeforces426;

/**
 *
 * @author superuser
 */
import java.util.*;
import java.io.*;
import java.math.BigInteger;

/**
 *
 * @author rohan
 */

public class ProblemB {

    static long mod = (int) (1e9+7);

    static int prev=0;

    static void solve() {
	int n = sc.nextInt();
        int k = sc.nextInt();
        String s = sc.nextLine();
        int[] lastoccurence = new int[26];
        int[] vis = new int[26];
        int count=0;
        for(int i=0;i<n;i++)
            lastoccurence[s.charAt(i)-'A']=i;
        //debug(lastoccurence);
        for(int i=0;i<n;i++)
        {
            int x = s.charAt(i)-'A';
            if(vis[x]==0 || i!=lastoccurence[x])
            {
                if(vis[x]==0)
                {
                    count++;
                    vis[x]=1;
                }
                if(i==lastoccurence[x])
                    count--;

            }
            else
                count--;
           // out.println(count);
            if(count>k)
            {
                prev=1;
                break;
            }
        }
        if(prev==1)
            out.println("YES");
        else
            out.println("NO");

        out.close();

    }

    static InputReader sc = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);
    public static void main(String[] args) {

        new Thread(null,new Runnable() {
            @Override
            public void run() {
                try{
                    solve();
                }
                catch(Exception e){
                    e.printStackTrace();
                }
            }
        },"1",1<<26).start();
    }

    static class Pair implements Comparable<Pair>{

        int x,y,i;

	Pair (int x,int y,int i){
		this.x = x;
		this.y = y;
                this.i = i;
	}

        Pair (int x,int y){
		this.x = x;
		this.y = y;
	}

	public int compareTo(Pair o) {
                    return -Integer.compare(this.i,o.i);
		//return 0;
	}

        public boolean equals(Object o) {
            if (o instanceof Pair) {
                Pair p = (Pair)o;
                return p.x == x && p.y==y;
            }
            return false;
        }

        @Override
        public String toString() {
            return x + " "+ y + " "+i;
        }

        public int hashCode() {
            return new Long(x).hashCode() * 31 + new Long(y).hashCode();
        }

    }

    static class Merge {

        public static void sort(int inputArr[]) {
            int length = inputArr.length;
            doMergeSort(inputArr,0, length - 1);
        }

        private static void doMergeSort(int[] arr,int lowerIndex, int higherIndex) {
            if (lowerIndex < higherIndex) {
                int middle = lowerIndex + (higherIndex - lowerIndex) / 2;
                doMergeSort(arr,lowerIndex, middle);
                doMergeSort(arr,middle + 1, higherIndex);
                mergeParts(arr,lowerIndex, middle, higherIndex);
            }
        }

        private static void mergeParts(int[]array,int lowerIndex, int middle, int higherIndex) {
            int[] temp=new int[higherIndex-lowerIndex+1];
            for (int i = lowerIndex; i <= higherIndex; i++) {
                temp[i-lowerIndex] = array[i];
            }
            int i = lowerIndex;
            int j = middle + 1;
            int k = lowerIndex;
            while (i <= middle && j <= higherIndex) {
                if (temp[i-lowerIndex] < temp[j-lowerIndex]) {
                    array[k] = temp[i-lowerIndex];
                    i++;
                } else {
                    array[k] = temp[j-lowerIndex];
                    j++;
                }
                k++;
            }
            while (i <= middle) {
                array[k] = temp[i-lowerIndex];
                k++;
                i++;
            }
            while(j<=higherIndex){
                array[k]=temp[j-lowerIndex];
                k++;
                j++;
            }
        }

    }

    static long add(long a,long b){
        long x=(a+b);
        while(x>=mod) x-=mod;
        return x;
    }

    static long sub(long a,long b){
        long x=(a-b);
        while(x<0) x+=mod;
        return x;
    }

    static long mul(long a,long b){
        a%=mod;
        b%=mod;
        long x=(a*b);
        return x%mod;
    }

    static boolean isPal(String s){
        for(int i=0, j=s.length()-1;i<=j;i++,j--){
                if(s.charAt(i)!=s.charAt(j)) return false;
        }
        return true;
    }
    static String rev(String s){
                StringBuilder sb=new StringBuilder(s);
                sb.reverse();
                return sb.toString();
    }

    static long gcd(long x,long y){
        if(y==0)
                return x;
        else
                return gcd(y,x%y);
    }

    static int gcd(int x,int y){
        if(y==0)
                return x;
        else
                return gcd(y,x%y);
    }

    static long gcdExtended(long a,long b,long[] x){

        if(a==0){
            x[0]=0;
            x[1]=1;
            return b;
        }
        long[] y=new long[2];
        long gcd=gcdExtended(b%a, a, y);

        x[0]=y[1]-(b/a)*y[0];
        x[1]=y[0];

        return gcd;
    }

    static long mulmod(long  a,long b,long m) {
        if (m <= 1000000009) return a * b % m;

        long res = 0;
        while (a > 0) {
            if ((a&1)!=0) {
                res += b;
                if (res >= m) res -= m;
            }
            a >>= 1;
            b <<= 1;
            if (b >= m) b -= m;
        }
        return res;
    }

    static int abs(int a,int b){
        return (int)Math.abs(a-b);
    }

    public static long abs(long a,long b){
        return (long)Math.abs(a-b);
    }

    static int max(int a,int b){
        if(a>b)
                return a;
        else
                return b;
    }

    static int min(int a,int b){
        if(a>b)
                return b;
        else
                return a;
    }

    static long max(long a,long b){
        if(a>b)
                return a;
        else
                return b;
    }

    static long min(long a,long b){
        if(a>b)
                return b;
        else
                return a;
    }

    static long pow(long n,long p,long m){
         long  result = 1;
          if(p==0)
            return 1;

        while(p!=0)
        {
            if(p%2==1)
                result *= n;
            if(result>=m)
            result%=m;
            p >>=1;
            n*=n;
            if(n>=m)
            n%=m;
        }
        return result;
    }

    static long pow(long n,long p){
        long  result = 1;
          if(p==0)
            return 1;

        while(p!=0)
        {
            if(p%2==1)
                result *= n;
            p >>=1;
            n*=n;
        }
        return result;
    }

    static void debug(Object... o) {
            System.out.println(Arrays.deepToString(o));
    }

    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
                this.stream = stream;
        }

        public int snext() {
                if (snumChars == -1)
                        throw new InputMismatchException();
                if (curChar >= snumChars) {
                        curChar = 0;
                        try {
                                snumChars = stream.read(buf);
                        } catch (IOException e) {
                                throw new InputMismatchException();
                        }
                        if (snumChars <= 0)
                                return -1;
                }
                return buf[curChar++];
        }

        public int nextInt() {
                int c = snext();
                while (isSpaceChar(c)) {
                        c = snext();
                }
                int sgn = 1;
                if (c == '-') {
                        sgn = -1;
                        c = snext();
                }
                int res = 0;
                do {
                        if (c < '0' || c > '9')
                                throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
        }

        public long nextLong() {
                int c = snext();
                while (isSpaceChar(c)) {
                        c = snext();
                }
                int sgn = 1;
                if (c == '-') {
                        sgn = -1;
                        c = snext();
                }
                long res = 0;
                do {
                        if (c < '0' || c > '9')
                                throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
        }

        public int[] nextIntArray(int n) {
                int a[] = new int[n];
                for (int i = 0; i < n; i++) {
                        a[i] = nextInt();
                }
                return a;
        }

        public long[] nextLongArray(int n) {
                long a[] = new long[n];
                for (int i = 0; i < n; i++) {
                        a[i] = nextLong();
                }
                return a;
        }

        public String readString() {
                int c = snext();
                while (isSpaceChar(c)) {
                        c = snext();
                }
                StringBuilder res = new StringBuilder();
                do {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isSpaceChar(c));
                return res.toString();
        }

        public String nextLine() {
                int c = snext();
                while (isSpaceChar(c))
                        c = snext();
                StringBuilder res = new StringBuilder();
                do {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isEndOfLine(c));
                return res.toString();
        }

        public boolean isSpaceChar(int c) {
                if (filter != null)
                        return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
                return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
        }

    }
}

import java.util.*;
public class Main
{
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		String s=sc.next();
		int count[]=new int[27];
		int open[]=new int[27];
		for(int i=0;i<n;i++)
		{
			int x=(int)s.charAt(i);
			count[x-65]++;
		}
		int flag=0;
		for(int i=0;i<n;i++)
		{
			int x=(int)s.charAt(i);
			open[x-65]=1;
			count[x-65]--;
			int c=0;
			for(int j=0;j<26;j++)
				if(count[j]>0&&open[j]==1)
					c++;
			if(c>k)
			{
				flag=1;
				break;
			}
		}
		if(flag==1)
			System.out.println("YES");
		else
			System.out.println("NO");
	}
}

import java.util.*;
import java.lang.*;
import java.io.*;

public class Ideone	{
	public static void main (String[] args) throws java.lang.Exception	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s = br.readLine();
		int l = Integer.parseInt(s.split(" ")[0]), g = Integer.parseInt(s.split(" ")[1]);
		s = br.readLine();
		int a[] = new int[l];
		for(int i=0;i<l;i++)	a[i]=0;
		for(char c = 'A';c<='Z';c++)	for(int i=s.indexOf(c);i<s.lastIndexOf(c);i++)	if(i>0)	a[i]++;
		boolean flag=true;
		for(int i=0;i<l;i++)	if(a[i]>g)	flag=false;
		System.out.println(flag?"NO":"YES");
	}
}

import java.util.Arrays;
import java.util.Scanner;

public class Guard {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int inputSize = scn.nextInt();
		int guards = scn.nextInt();
		String str = scn.next();

		int[] start = new int[26];
		Arrays.fill(start, -1);

		int[] end = new int[26];
		Arrays.fill(end, -1);

		Arrays.sort(start);
		Arrays.sort(end);

		for (int i = 0; i < str.length(); i++) {
			int a = (int) str.charAt(i) - (int) 'A';
			if (start[a] == -1) {
				start[a] = i;
			} else {
				end[a] = i;
			}
		}

		for (int i = 0; i < 25; i++) {
			if (start[i] != -1 && end[i] == -1) {
				end[i] = start[i] + 1;
			}
		}

		int max = 0;
		int count = 0;
		int plat_needed = 1, result = 1;
		int i = 1, j = 0;
		int n = 26;
		// Similar to merge in merge sort to process
		// all events in sorted order
		while (i < n && j < n && start[i] != -1) {
			// If next event in sorted order is arrival,
			// increment count of platforms needed
			if (start[i] <= end[j]) {
				plat_needed++;
				i++;

				// Update result if needed
				if (plat_needed > result)
					result = plat_needed;
			}

			// Else decrement count of platforms needed
			else {
				plat_needed--;
				j++;
			}
		}

		if (guards < result) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

		scn.close();
	}
}

import java.util.Scanner;

public class azx
{

	public static void main(String[] args)
	{
		Scanner cin= new Scanner(System.in);
		int n=cin.nextInt();
		int k=cin.nextInt();
		String str=cin.next();
		int arr[]= new int[n+1];
		for (char c='A';c<'Z';c++)
		{
			if(str.indexOf(""+c)!=-1)
			{
			arr[str.indexOf(""+c)]+=1;
			arr[str.lastIndexOf(""+c)+1]+=-1;
			}
		}
		int min=0;
		for (int i = 1; i <arr.length; i++)
		{
			arr[i]=arr[i]+arr[i-1];
			if(arr[i]>min)
			{
				min=arr[i];
			}
		}
		if(k>=min)
		{
			System.out.println("YES");
		}
		else
		{
			System.out.println("NO");
		}

	}

}

import java.io.*;
import java.util.*;
import java.math.*;

/**
 *
 * @author ghost
 */
public class B {

    public static void main(String args[])
    {

        //File file= new File("COMPLETE_FILE_PATH");
        //InputStream is = new FileInputStream(file);

        //InputReader in = new InputReader(is);
        InputReader in = new InputReader(System.in);
        PrintWriter out= new PrintWriter(System.out);

        int t=1;

        Task solver=new Task();
        solver.solve(t,in,out);

        out.flush();
        out.close();

    }

    static class Task {
        long mod = 1000000007;

        public void solve(int testNumber, InputReader in,PrintWriter out){

            int n=in.nextInt();int  k=in.nextInt();

            char[] guest=new char[n];
            guest=in.next().toCharArray();

            int[][] timing=new int[26][2];
            for(int i=0;i<26;i++){
                timing[i][1]=Integer.MIN_VALUE;
                timing[i][0]=Integer.MAX_VALUE;
           }

            for(int i=0;i<guest.length;i++){
                if(timing[guest[i]-'A'][0]>i)  {
                    timing[guest[i]-'A'][0]=i;

                }
                if(timing[guest[i]-'A'][1]<i){
                    timing[guest[i]-'A'][1]=i;
                }
            }

//            for(int i=0;i<26;i++){
//                for(int j=0;j<2;j++){
//                    out.print(timing[i][j]+" ");
//                }
//                out.println();
//            }

            int count=0;
            int last=Integer.MAX_VALUE;
            for(int i=0;i<25;i++){
                if(timing[i][0]<last)
                    count++;
                if(last<0)
                    last=timing[i][1];
                last=Math.min(last, timing[i][1]);
            }

//            out.println(count);
            out.println(k>=count?"NO":"YES");
        }

        int LOG2(long item){
            int count=0;
            while(item>1){
                item>>=1;count++;
            }
            return count;
        }

        long gcd(long a, long b) {
            a = Math.abs(a);
            b = Math.abs(b);
            return BigInteger.valueOf(a).gcd(BigInteger.valueOf(b)).longValue();
        }
    }

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String next() {
            return readString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }

        private static void pa(Object... o) {
            System.out.println(Arrays.deepToString(o));
        }
    }

}

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    private static String getPartyStatus(char[] guests, Map<Character, Integer> map, int guardCount) {
        int availableGuards = guardCount;
        Map<Character, Integer> enteredGuests = new HashMap<>(26);
        Integer cnt = 0;
        for (char enteringGuest : guests) {
            cnt = enteredGuests.get(enteringGuest);
            if (cnt == null) {
                --availableGuards;
                cnt = 0;
            }
            enteredGuests.put(enteringGuest, ++cnt);
            if (enteredGuests.get(enteringGuest).equals(map.get(enteringGuest))) {
                ++availableGuards;
            }
            if (availableGuards < 0) {
                return "YES";
            }
        }
        return "NO";
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int guardCount = scanner.nextInt();
        Map<Character, Integer> map = new HashMap<>(26);
        String guestSequence = scanner.next();
        Integer curCharCount = 0;
        for (char i : guestSequence.toCharArray()) {
            curCharCount = map.get(i);
            if (curCharCount != null) {
                map.put(i, curCharCount + 1);
            } else {
                map.put(i, 1);
            }
        }
        System.out.println(getPartyStatus(guestSequence.toCharArray(), map, guardCount));
        scanner.close();
    }
}

import java.util.*;
import java.io.*;

public class Codeforces827B {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());
		char[] lst = new char[n];
		st = new StringTokenizer(br.readLine());
		String s = st.nextToken();
		for (int i = 0; i < n; i++) {
			lst[i] = s.charAt(i);
		}

		int[] start = new int[26];
		int[] end = new int[26];
		for (int i = 1; i < 26; i++) {
			start[i] = -1;
			end[i] = -1;
		}

		for (int i = 1; i < n; i++) {
			int val = (int) lst[i] - 65;
			if (start[val] < 0) {
				start[val] = i;
			}
			end[val] = i;
		}

		boolean ans = true;

		for (int i = 0; i < n; i++) {
			int num = 0;
			for (int j = 0; j < 26; j++) {
				if ((start[j] <= i) && (end[j] >= i))
					num++;
			}
			if (num > k) {
				ans = false;
			}
		}

		if (ans)
			System.out.println("YES");
		else
			System.out.println("NO");

	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.AbstractMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.AbstractMap.SimpleEntry;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String[] split = in.nextLine().split(" ");
            int guests = Integer.parseInt(split[0]);
            int guards = Integer.parseInt(split[1]);
            String entrances = in.nextLine();

            HashSet<Character> doors = new HashSet<>();
            for (int i = 0; i < guests; i++) {
                doors.add(entrances.charAt(i));
            }

            HashSet<Map.Entry<Integer, Integer>> pairs = new HashSet<>();
            for (Character door : doors) {
                int start = entrances.indexOf(door);
                int end = entrances.lastIndexOf(door);
                pairs.add(new AbstractMap.SimpleEntry<>(start, end));
            }

            int maxIntersections = 0;

            for (Map.Entry<Integer, Integer> pair1 : pairs) {
                int currMaxIntersections = 0;
                for (Map.Entry<Integer, Integer> pair2 : pairs) {
                    if ((pair2.getKey() <= pair1.getValue() && pair2.getValue() >= pair1.getKey())) {
                        currMaxIntersections++;
                    }
                }
                maxIntersections = Math.max(currMaxIntersections, maxIntersections);
            }

            if (maxIntersections > guards) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }
    }
}

import java.util.*;
public class theFestiveEvening {
        public static String gaurdsRequired(String g,int k) {
                int discontinuity=0;
                int distinct=0;
                for(int i=0; i<g.length()-1; i++) {
                        if(g.charAt(i)!=g.charAt(i+1)) discontinuity++;
                }
                HashSet<Character> h = new HashSet<Character>();
                for(int i=0;i<g.length();i++) {
                        h.add(g.charAt(i));
                }
                distinct=h.size();
                int res= discontinuity < distinct ? discontinuity : distinct;
                if(distinct == g.length()) {
                        res = distinct;
                }
                if(res <= k || res==g.length()) {
                        return "NO";
                }
                else
                        return "YES";
        }
        public static void main(String[] args) {
                Scanner input = new Scanner(System.in);
                String[] nk = input.nextLine().split(" ");
                int n = Integer.parseInt(nk[0]);
                int k = Integer.parseInt(nk[1]);
                String g = input.nextLine();
                String res = gaurdsRequired(g, k);
                System.out.println(res);
        }
}

import java.util.*;
public class Main {
	static int a,b,c,x[],y[],N=10000005;
	public static void main(String args[]){
		Scanner reader=new Scanner(System.in);
		int a=reader.nextInt();
		int b=reader.nextInt();
		String s=reader.next();
		int x[]=new int[26];
		int y[]=new int[26];
		int sum=0;
		for(int n=0;n<26;n++){
			x[n]=N;
			y[n]=N;
		}
		for(int n=1;n<=a;n++){
			int t=s.charAt(n-1)-'A';
			if(x[t]==N){
				x[t]=n;
				y[t]=n;
				sum++;
			}
			else{
				y[t]=n;
			}
		}
		int k=0;
		int max=0;
		Arrays.sort(x);
		Arrays.sort(y);
		int num=y[0];
		int st=1;
		for(int n=0;n<sum;n++){
			if(x[n]<=num){
				k++;
				max=Math.max(max, k);
			}
			else{
				k--;
				num=y[st];
				st++;
			}
		}
		if(max>b){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}

	}

}

import java.io.*;
import java.util.*;

public class Solution{

    public static void main(String[] args) throws Exception{
        int[] nk = in.readA();
        int n = nk[0], k = nk[1];
        char[] guest = in.readLine().toCharArray();
        boolean possible = true;
        boolean[] alpha = new boolean[26];
        int[] first = new int[26];
        int[] end = new int[26];
        Arrays.fill(first, -1);
        Arrays.fill(end, -1);
        for(int i = 0; i < n; i++){
            if(first[guest[i] - 'A'] == -1) first[guest[i]-'A'] = i;
            end[guest[i]-'A'] = i;
        }

        int r = -1, c = 0;
        for(int i = 0; i < n; i++){
            if(i > r){
                if(c > k)
                   possible = false;
                c = 0;
                Arrays.fill(alpha, false);
            }
            r = Math.max(r, end[guest[i] - 'A']);
            if(!alpha[guest[i] - 'A'])
                c++;
            alpha[guest[i] - 'A'] = true;
            if(i == n-1){
                if(c > k)
                   possible = false;
            }
        }

        if(!possible)   System.out.println("YES");
        else System.out.println("NO");
    }

    static Inputer in;
    static {
        in = new Inputer();
    }

    static class Inputer{
        BufferedReader br;
        Inputer(){
            try{
                br = new BufferedReader(new InputStreamReader(System.in));
            }
            catch(Exception e){}
        }
        public int readInt() throws Exception{
            return Integer.parseInt(readLine());
        }
        public long readLong() throws Exception{
            return Long.parseLong(readLine());
        }
        public int[] readA(String delim) throws Exception{
            String[] s = readLine().split(delim);
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public int[] readA() throws Exception{
            String[] s = readLine().split("\\s+");
            int[] A = new int[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Integer.parseInt(s[i]);
            return A;
        }
        public long[] readLA() throws Exception{
            String[] s = readLine().split("\\s+");
            long[] A = new long[s.length];
            for(int i = 0; i < s.length; i++)
                A[i] = Long.parseLong(s[i]);
            return A;
        }
        public String readLine() throws Exception{
            return br.readLine();
        }
        public int[] copyA(int[] A){
            int[] B = new int[A.length];
            for(int i= 0 ; i < A.length; i++)
                B[i] = A[i];
            return B;
        }
    }
}

import java.util.*;

public class B {
	public static void main(String... args) {
		Scanner input = new Scanner(System.in);
		int N = input.nextInt();
		int K = input.nextInt();
		char[] line = input.next().toCharArray();

		Door[] door = new Door[26];
		for (int i = 0; i < door.length; i++)
			door[i] = new Door();

		for (int i = 0; i < line.length; i++) {
			if (door[(line[i] % 65)].start == -1)
				door[(line[i] % 65)].start = i;
			else
				door[(line[i] % 65)].end = i;
		}

		boolean[] check = new boolean[26];
		int curK = K;
		for (int i = 0; i < line.length; i++) {
			if (!check[line[i] % 65]) {
				check[line[i] % 65] = true;
				curK--;
			}

			if (check[line[i] % 65]) {
				if (door[line[i] % 65].end != i) {
					if (curK < 0) {
						System.out.print("YES");
						System.exit(0);
					}
				} else
					curK++;
			}
		}

		System.out.print("NO");
	}

	private static class Door {
		public int start;
		public int end;

		public Door() {
			this.start = -1;
			this.end = -1;
		}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class ProblemB {

	static Scanner sc = new Scanner(System.in);
	static PrintWriter pw = new PrintWriter(System.out);

	public static void main(String[] args) throws IOException {
		int n = sc.nextInt(), k = sc.nextInt();
		String s = sc.next();
		int[] start = new int[26], end = new int[26];
		Arrays.fill(start, (int) 1e7);
		for (int i = 0; i < n; i++) {
			int curr = s.charAt(i) - 'A';
			start[curr] = Math.min(start[curr], i);
			end[curr] = i;
		}

		boolean done[] = new boolean[26];
		for (int i = 0; i < 26; i++) {
			if (start[i] == 1e7)
				done[i] = true;
		}
		int needed = 0;
		for (int i = 0; i < 26; i++) {
			if (!done[i]) {
				done[i] = true;
				for (int j = i + 1; j < 26; j++) {
					if (!done[j] && (start[i] > end[j] || start[j] > end[i])) {
						done[j] = true;
					}
				}
				needed++;
			}
		}
		if(needed<=k){
			System.out.println("NO");
		}
		else System.out.println("YES");
		pw.flush();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] array = new int[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextInt();
			}
			return array;
		}
	}
}

import java.util.Scanner;

public class C426B {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int guests = scanner.nextInt();
        int guardsAvailable = scanner.nextInt();

        String doors = scanner.next();
        boolean[] arrived = new boolean[26];
        boolean[] taken = new boolean[guests];
        boolean[] left = new boolean[26];
        boolean[] available = new boolean[guests];
        boolean[] justArrived = new boolean[guests];

        for (int i = 0; i < guests; i++) {
            if (!arrived[doors.charAt(i) - 'A']){
                arrived[doors.charAt(i) - 'A'] = true;
                taken[i] = true;
                justArrived[i] = true;
//                System.out.println(i);
            }
        }

        for (int i = guests - 1; i >= 0; i--) {
            if (!left[doors.charAt(i) - 'A']){
                left[doors.charAt(i) - 'A'] = true;
                available[i] = true;
            }
        }
        boolean unguarded = false;

        for (int i = 0; i < guests; i++) {
//            System.out.println(taken[i]);
            if (available[i] && !taken[i]){
//                System.out.println(i);
                guardsAvailable++;
            }

            if (guardsAvailable <= 0 && !(i == guests - 1) && justArrived[i]){
                unguarded = true;
                break;
            }

            if (taken[i]){
                guardsAvailable--;
//                System.out.println(i);
            }
        }

        if (unguarded) System.out.println("YES");
        else System.out.println("NO");
    }
}

import java.util.*;
import java.io.*;

public class Random {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        if(n>k){
            String s=sc.next();
            int[] count=new int[26];
            for(int i=0;i<s.length();i++){
                count[s.charAt(i)-'A']++;
            }
            //System.out.println(Arrays.toString(count));

            boolean[] visited=new boolean[26];
            for(int i=0;i<26;i++){
                visited[i]=false;
            }

            for(int i=0;i<s.length();i++){
                if(k==-1){
                    break;
                }

                if(visited[s.charAt(i)-'A']==true){
                    count[s.charAt(i) - 'A']--;
                }
                else if(visited[s.charAt(i)-'A']==false){
                    count[s.charAt(i) - 'A']--;
                    visited[s.charAt(i)-'A']=true;
                    k--;
                    //System.out.println(k);
                }
                if(count[s.charAt(i)-'A']==0){
                    k++;
                    //System.out.println(k);
                }

            }

            if(k>0){
                System.out.println("NO");
            }
            else
                System.out.println("YES");

        }
        else
            System.out.println("NO");
    }
}

import java.util.*;

public class TestCase
{
    public static void main (String[] args) {
        Scanner ob=new Scanner(System.in);
        int n=ob.nextInt();
        int k=ob.nextInt();
        String s=ob.next();
        int hash[]=new int[99];
        int dp[]=new int[n];
        int flag=0;
        int open=0;
        //System.out.println(hash[25]);
        for(int i=0;i<s.length();i++)
        {
            char ch=s.charAt(i);
            hash[ch]++;
            if(hash[ch]==1){
                //System.out.println(ch);
                int idx=s.lastIndexOf(ch);
                //System.out.println(idx);
                dp[idx]=1;
                //System.out.println(dp[idx]);
                open++;
            }
            //System.out.println(dp[i]);
            open=open-dp[i];
            //System.out.println(open);
            if(open>k)
            {
                flag=1;
                break;
            }
            open=open-dp[i];
        }
        if(flag==1)
        System.out.println("YES");
        else
        System.out.println("NO");
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author uweto
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt(), k = in.nextInt();
            String a = in.next().toLowerCase();
            int[] lastIndices = new int[26];
            for (int i = n - 1; i >= 0; i--) {
                if (lastIndices[a.charAt(i) - 'a'] < i) lastIndices[a.charAt(i) - 'a'] = i;
            }
            int[] g = new int[26];
            for (int i = 0; i < n && k >= 0; i++) {
                if (g[a.charAt(i) - 'a'] != 1) {
                    g[a.charAt(i) - 'a'] = 1;
                    if (i != lastIndices[a.charAt(i) - 'a']) k--;
                } else if (g[a.charAt(i) - 'a'] == 1 && i == lastIndices[a.charAt(i) - 'a']) {
                    k++;
                    g[a.charAt(i) - 'a'] = 1;
                }
            }
            //out.println(k);
            if (k < 0) out.println("YES");
            else out.println("NO");
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.util.*;

public class CF {

    static Scanner sc = new Scanner(System.in);
    static int numberOfGardes;
    static int arr[] = new int[26];
    static char[] ch;
    static HashSet<Character> haveG = new HashSet<>();

    static void fill() {
        ch = sc.next().toCharArray();

        for (char c : ch) {
            arr[c - 65]++;
        }
    }

    static void check(char c) {
        int index = c - 65;
        arr[index]--;
        if (arr[index] == 0) {
            numberOfGardes++;
        }

    }

    static void can(char c) {

        check(c);

        if (haveG.contains(c)) {
            return;
        }
        if (numberOfGardes == 0) {
            System.out.println("YES");
            System.exit(0);
        }
        numberOfGardes--;
        haveG.add(c);
    }

    static void solve() {
        for (char c : ch) {
            can(c);
        }
        System.out.println("NO");
    }

    public static void main(String[] args) {
        sc.nextInt();
        numberOfGardes = sc.nextInt();
        fill();
        solve();
    }
}

//package TIM;

import java.lang.reflect.Array;
import java.math.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int k = input.nextInt();
        char[] s = new char[1000005];
        s = input.next().toCharArray();
        int[] a = new int[26];
        for (int i = 0; i < n; i++)
            a[s[i] - 'A']++;
        int door;
        for (int i = 0; i < n; i++) {
            door = 0;
            while (i != n - 1 && s[i] == s[i + 1]) {
                a[s[i] - 'A']--;
                i++;
            }
            a[s[i] - 'A']--;
            for (int j = 0; j < 26; j++)
                if (a[j] > 0) door++;
            if (door > k) {
                System.out.println("YES");
                return;
            }
        }
        System.out.println("NO");
    }
}

import java.io.*;
import java.util.StringTokenizer;
public class FestiveEvening {
    public static void main(String[] args) throws IOException, InterruptedException {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int [] a=new int[26];
        int n=sc.nextInt();
        int k=sc.nextInt();
        char arr[]=sc.nextLine().toCharArray();
        int count=0;
        for(int i=0;i<n;i++) {
        	char c=arr[i];
        	++a[c-65];
        	if(a[c-65]!=0 && a[c-65]%2!=0)
        		count++;
        	if(a[c-65]%2==0)
        		count--;
        	if(count>k) {
        		pw.println("YES");
        		pw.flush();
        		return;
        	}
        }
        pw.println("NO");
        pw.flush();
    }

    static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream system) {br = new BufferedReader(new InputStreamReader(system));}
        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        public String nextLine()throws IOException{return br.readLine();}
        public int nextInt() throws IOException {return Integer.parseInt(next());}
        public double nextDouble() throws IOException {return Double.parseDouble(next());}
        public char nextChar()throws IOException{return next().charAt(0);}
        public Long nextLong()throws IOException{return Long.parseLong(next());}
        public boolean ready() throws IOException{return br.ready();}
        public void waitForInput() throws InterruptedException {Thread.sleep(4000);}
    }
 }

import java.util.*;

public class B {
	public static void main(String... args) {
		Scanner input = new Scanner(System.in);
		int N = input.nextInt();
		int K = input.nextInt();
		char[] line = input.next().toCharArray();

		Door[] door = new Door[26];
		for (int i = 0; i < door.length; i++)
			door[i] = new Door();

		for (int i = 0; i < line.length; i++) {
			if (door[(line[i] % 65)].start == -1)
				door[(line[i] % 65)].start = i;
			else
				door[(line[i] % 65)].end = i;
		}

		boolean[] check = new boolean[26];
		int curK = K;
		for (int i = 0; i < line.length; i++) {
			if (!check[line[i] % 65]) {
				if (curK <= 0) {
					System.out.print("YES");
					System.exit(0);
				}

				check[line[i] % 65] = true;
				curK--;
			}

			if (check[line[i] % 65] && door[line[i] % 65].end == i)
				curK++;
		}

		System.out.print("NO");
	}

	private static class Door {
		public int start;
		public int end;

		public Door() {
			this.start = -1;
			this.end = -1;
		}
	}
}

import java.util.Scanner;

public class Problems {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String st = sc.next();
        int[][] matrix = new int[26][2];
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[i].length; j++) {
                matrix[i][j] = -1;
            }
        }
        for (int i = 0; i < st.length(); i++) {
            char c = st.charAt(i);
            if (matrix[c - 65][0] == -1) {
                matrix[c - 65][0] = i;
            }
            if (matrix[c - 65][1] < i) {
                matrix[c - 65][1] = i;
            }
        }

        int numberOfOpenDoors = 0;

        for (int i = 0; i < st.length(); i++) {
            char c = st.charAt(i);
            if (matrix[c - 65][0] == i) {
                numberOfOpenDoors++;
            }
            if (matrix[c - 65][1] == i) {
                numberOfOpenDoors--;
            }
            if (numberOfOpenDoors > k) {
                System.out.println("YES");
                System.exit(0);
            }
        }
        System.out.println("NO");
    }
}

import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.StringTokenizer;
public class CF426A {
    public static void main(String[]args)throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        int n=Integer.parseInt(st.nextToken());
        int k=Integer.parseInt(st.nextToken());
        int arr[][]=new int[26][2];
        char cc[]=br.readLine().toCharArray();
        for(int i=0;i<26;i++)
        {
            arr[i][0]=-1;
            arr[i][1]=-1;
        }
        for(int i=0;i<n;i++)
        {
            int a=cc[i]-'A';
            if(arr[a][0]==-1)
                arr[a][0]=i;
            arr[a][1]=i;
        }
//        for(int i=0;i<26;i++)
//            System.out.println(arr[i][0]+"  "+arr[i][1]);
        int max=0;
        for(int i=0;i<26;i++)
        {
            if(arr[i][0]==-1)
                continue;
            else
            {
                int in=arr[i][0];
                int out=arr[i][1];
                int temp=0;
                for(int j=0;j<26;j++)
                {
                    if(arr[j][0]==-1)
                        continue;
                    if((arr[j][0]>=in&&arr[j][0]<=out)||((arr[j][1]>=in)&&(arr[j][1]<=out)))
                        temp++;
                }
                if(temp>max)
                    max=temp;
//                System.out.println(max);
            }
        }
        if(max>k)
            System.out.println("YES");
        else
            System.out.println("NO");

    }
}

import java.util.*;
import java.lang.*;
import java.io.*;

public class Ideone	{
	public static void main (String[] args) throws java.lang.Exception	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s = br.readLine();
		int l = Integer.parseInt(s.split(" ")[0]), g = Integer.parseInt(s.split(" ")[1]);
		s = br.readLine();
		int a[] = new int[l];
		for(int i=0;i<l;i++)	a[i]=0;
		for(char c = 'A';c<='Z';c++)	for(int i=s.indexOf(c);i<s.lastIndexOf(c);i++)	if(i>0)	a[i]++;
		boolean flag=true;
		for(int i=0;i<l;i++)	if(a[i]>g)	flag=false;
		System.out.println(flag?"NO":"YES");
	}
}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package codeforces426;

/**
 *
 * @author superuser
 */
import java.util.*;
import java.io.*;
import java.math.BigInteger;

/**
 *
 * @author rohan
 */

public class ProblemB {

    static long mod = (int) (1e9+7);

    static int prev=0;

    static void solve() {
	int n = sc.nextInt();
        int k = sc.nextInt();
        String s = sc.nextLine();
        int[] lastoccurence = new int[26];
        int[] vis = new int[26];
        int count=0;
        for(int i=0;i<n;i++)
            lastoccurence[s.charAt(i)-'A']=i;
        //debug(lastoccurence);
        for(int i=0;i<n;i++)
        {
            int x = s.charAt(i)-'A';
            if(vis[x]==0 || i!=lastoccurence[x])
            {
                if(vis[x]==0)
                {
                    count++;
                    vis[x]=1;
                }
            }
            else
                count--;
           // out.println(count);
            if(count>k)
            {
                prev=1;
                break;
            }
        }
        if(prev==1)
            out.println("YES");
        else
            out.println("NO");

        out.close();

    }

    static InputReader sc = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);
    public static void main(String[] args) {

        new Thread(null,new Runnable() {
            @Override
            public void run() {
                try{
                    solve();
                }
                catch(Exception e){
                    e.printStackTrace();
                }
            }
        },"1",1<<26).start();
    }

    static class Pair implements Comparable<Pair>{

        int x,y,i;

	Pair (int x,int y,int i){
		this.x = x;
		this.y = y;
                this.i = i;
	}

        Pair (int x,int y){
		this.x = x;
		this.y = y;
	}

	public int compareTo(Pair o) {
                    return -Integer.compare(this.i,o.i);
		//return 0;
	}

        public boolean equals(Object o) {
            if (o instanceof Pair) {
                Pair p = (Pair)o;
                return p.x == x && p.y==y;
            }
            return false;
        }

        @Override
        public String toString() {
            return x + " "+ y + " "+i;
        }

        public int hashCode() {
            return new Long(x).hashCode() * 31 + new Long(y).hashCode();
        }

    }

    static class Merge {

        public static void sort(int inputArr[]) {
            int length = inputArr.length;
            doMergeSort(inputArr,0, length - 1);
        }

        private static void doMergeSort(int[] arr,int lowerIndex, int higherIndex) {
            if (lowerIndex < higherIndex) {
                int middle = lowerIndex + (higherIndex - lowerIndex) / 2;
                doMergeSort(arr,lowerIndex, middle);
                doMergeSort(arr,middle + 1, higherIndex);
                mergeParts(arr,lowerIndex, middle, higherIndex);
            }
        }

        private static void mergeParts(int[]array,int lowerIndex, int middle, int higherIndex) {
            int[] temp=new int[higherIndex-lowerIndex+1];
            for (int i = lowerIndex; i <= higherIndex; i++) {
                temp[i-lowerIndex] = array[i];
            }
            int i = lowerIndex;
            int j = middle + 1;
            int k = lowerIndex;
            while (i <= middle && j <= higherIndex) {
                if (temp[i-lowerIndex] < temp[j-lowerIndex]) {
                    array[k] = temp[i-lowerIndex];
                    i++;
                } else {
                    array[k] = temp[j-lowerIndex];
                    j++;
                }
                k++;
            }
            while (i <= middle) {
                array[k] = temp[i-lowerIndex];
                k++;
                i++;
            }
            while(j<=higherIndex){
                array[k]=temp[j-lowerIndex];
                k++;
                j++;
            }
        }

    }

    static long add(long a,long b){
        long x=(a+b);
        while(x>=mod) x-=mod;
        return x;
    }

    static long sub(long a,long b){
        long x=(a-b);
        while(x<0) x+=mod;
        return x;
    }

    static long mul(long a,long b){
        a%=mod;
        b%=mod;
        long x=(a*b);
        return x%mod;
    }

    static boolean isPal(String s){
        for(int i=0, j=s.length()-1;i<=j;i++,j--){
                if(s.charAt(i)!=s.charAt(j)) return false;
        }
        return true;
    }
    static String rev(String s){
                StringBuilder sb=new StringBuilder(s);
                sb.reverse();
                return sb.toString();
    }

    static long gcd(long x,long y){
        if(y==0)
                return x;
        else
                return gcd(y,x%y);
    }

    static int gcd(int x,int y){
        if(y==0)
                return x;
        else
                return gcd(y,x%y);
    }

    static long gcdExtended(long a,long b,long[] x){

        if(a==0){
            x[0]=0;
            x[1]=1;
            return b;
        }
        long[] y=new long[2];
        long gcd=gcdExtended(b%a, a, y);

        x[0]=y[1]-(b/a)*y[0];
        x[1]=y[0];

        return gcd;
    }

    static long mulmod(long  a,long b,long m) {
        if (m <= 1000000009) return a * b % m;

        long res = 0;
        while (a > 0) {
            if ((a&1)!=0) {
                res += b;
                if (res >= m) res -= m;
            }
            a >>= 1;
            b <<= 1;
            if (b >= m) b -= m;
        }
        return res;
    }

    static int abs(int a,int b){
        return (int)Math.abs(a-b);
    }

    public static long abs(long a,long b){
        return (long)Math.abs(a-b);
    }

    static int max(int a,int b){
        if(a>b)
                return a;
        else
                return b;
    }

    static int min(int a,int b){
        if(a>b)
                return b;
        else
                return a;
    }

    static long max(long a,long b){
        if(a>b)
                return a;
        else
                return b;
    }

    static long min(long a,long b){
        if(a>b)
                return b;
        else
                return a;
    }

    static long pow(long n,long p,long m){
         long  result = 1;
          if(p==0)
            return 1;

        while(p!=0)
        {
            if(p%2==1)
                result *= n;
            if(result>=m)
            result%=m;
            p >>=1;
            n*=n;
            if(n>=m)
            n%=m;
        }
        return result;
    }

    static long pow(long n,long p){
        long  result = 1;
          if(p==0)
            return 1;

        while(p!=0)
        {
            if(p%2==1)
                result *= n;
            p >>=1;
            n*=n;
        }
        return result;
    }

    static void debug(Object... o) {
            System.out.println(Arrays.deepToString(o));
    }

    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
                this.stream = stream;
        }

        public int snext() {
                if (snumChars == -1)
                        throw new InputMismatchException();
                if (curChar >= snumChars) {
                        curChar = 0;
                        try {
                                snumChars = stream.read(buf);
                        } catch (IOException e) {
                                throw new InputMismatchException();
                        }
                        if (snumChars <= 0)
                                return -1;
                }
                return buf[curChar++];
        }

        public int nextInt() {
                int c = snext();
                while (isSpaceChar(c)) {
                        c = snext();
                }
                int sgn = 1;
                if (c == '-') {
                        sgn = -1;
                        c = snext();
                }
                int res = 0;
                do {
                        if (c < '0' || c > '9')
                                throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
        }

        public long nextLong() {
                int c = snext();
                while (isSpaceChar(c)) {
                        c = snext();
                }
                int sgn = 1;
                if (c == '-') {
                        sgn = -1;
                        c = snext();
                }
                long res = 0;
                do {
                        if (c < '0' || c > '9')
                                throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
        }

        public int[] nextIntArray(int n) {
                int a[] = new int[n];
                for (int i = 0; i < n; i++) {
                        a[i] = nextInt();
                }
                return a;
        }

        public long[] nextLongArray(int n) {
                long a[] = new long[n];
                for (int i = 0; i < n; i++) {
                        a[i] = nextLong();
                }
                return a;
        }

        public String readString() {
                int c = snext();
                while (isSpaceChar(c)) {
                        c = snext();
                }
                StringBuilder res = new StringBuilder();
                do {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isSpaceChar(c));
                return res.toString();
        }

        public String nextLine() {
                int c = snext();
                while (isSpaceChar(c))
                        c = snext();
                StringBuilder res = new StringBuilder();
                do {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isEndOfLine(c));
                return res.toString();
        }

        public boolean isSpaceChar(int c) {
                if (filter != null)
                        return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
                return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
        }

    }
}

/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
public class S {
	public static void main (String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int k=in.nextInt();
		String s=in.next();
		Map<Character,Integer> map=new HashMap<>();
		for(int i=0;i<n;i++)
		{
		    if(!map.containsKey(s.charAt(i)))map.put(s.charAt(i),1);
		    else map.put(s.charAt(i),map.get(s.charAt(i))+1);
		}

		    Map<Character,Integer> temp=new HashMap<>();
		    int flag=0;
		    for(int i=0;i<n;i++)
		    {
		        if(!temp.containsKey(s.charAt(i)))temp.put(s.charAt(i),1);
		        else temp.put(s.charAt(i),temp.get(s.charAt(i))+1);
		        if(temp.size()>k)
		        {
		            flag=1;
		            break;
		        }
		        if(temp.get(s.charAt(i))==map.get(s.charAt(i)))
		        {
		            temp.remove(s.charAt(i));
		        }
		    }
		    //System.out.print(temp.size());
		    if(flag==1)System.out.print("YES");
		    else System.out.print("NO");
	}
}

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		int k=sc.nextInt();
		sc.nextLine();
		String s=sc.nextLine();
		int c=1,f=0;
		for(int i=0;i<n-1;i++)
    	{
	        if(s.charAt(i)!=s.charAt(i+1))
	        {
	            if(s.lastIndexOf(s.charAt(i))>i) c++;
	            if(c>k) {f=1;break;}
	        }
	    }
	    if(f==0)System.out.println("NO");
	    else System.out.println("YES");
	 }
}

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int k = sc.nextInt();
		sc.nextLine();
		String s = sc.nextLine();
		int [] num = new int[200];

		for (int i =0;i<n;i++)
		num[(int)s.charAt(i)]++;

		int [] count = new int[n];
		boolean flag =true;
		boolean [] gate = new boolean[200];
		Arrays.fill(gate,false);
		//count[0]=1;
		int [] c = new int[200];
		c[(int)s.charAt(0)]=1;
		if(c[(int)s.charAt(0)]==num[(int)s.charAt(0)])
		count[0]=0;
		else
		count[0]=1;

		for (int i =1;i<n;i++)
		{
		    if(c[(int)s.charAt(i)]==0)
		    {
		        count[i]=count[i-1]+1;
		    }
		    c[(int)s.charAt(i)]+=1;
		    if(c[(int)s.charAt(i)]==num[(int)s.charAt(i)])
		    count[i]--;

		    if(count[i]>k)
		    {
		        flag=false;
		        break;
		    }

		}
		if(flag==true)
		System.out.println("NO");
		else
		System.out.println("YES");

		sc.close();
	}
}

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n =scanner.nextInt();
		int m =scanner.nextInt();
		String string =scanner.next();
		char[] arr=  string.toCharArray();
		Map<Character, Integer> map = new HashMap<>();
		for (int i = 0; i < arr.length; i++) {
			map.put(arr[i], i);
		}
		Set<Character> set = new HashSet<>();
		int used =0;
		for(int i =0;i<arr.length;i++) {
			if (set.contains(arr[i])) {
				if (map.get(arr[i])==i) {
					used--;
				}
			}else {
				used++;
				if (used>m) {
					System.out.println("YES");
					return;
				}
			}
		}
		System.out.println("NO");

	}
}

import java.util.*;
public class B {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N=sc.nextInt();
        int K=sc.nextInt();
        String s=sc.nextLine();
        int[][] limit=new int[26][2];
        for (int i=0; i<26;i++){
            limit[i][0]=-1;
            limit[i][1]=-1;
        }
        for (int i=0; i<s.length(); i++){
            int cNum=(int)(s.charAt(i))-65;
            if (limit[cNum][0]==-1){
                limit[cNum][0]=i;
            }
            int cNum2=(int)(s.charAt(s.length()-i-1))-65;
            if (limit[cNum2][1]==-1){
                limit[cNum2][1]=s.length()-i-1;
            }
        }
        int[] arr=new int[26];
        for (int i=0; i<26; i++){
            for(int j=0; j<26;j++){
                if (i>=limit[j][0] && i<=limit[j][1]){
                    arr[i]=arr[i]+1;
                }
            }
        }
        Arrays.sort(arr);
        if (arr[25]>K){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
    }
}

import java.util.*;

public class TestCase
{
    public static void main (String[] args) {
        Scanner ob=new Scanner(System.in);
        int n=ob.nextInt();
        int k=ob.nextInt();
        String s=ob.next();
        int hash[]=new int[99];
        int dp[]=new int[n];
        int flag=0;
        int open=0;
        //System.out.println(hash[25]);
        for(int i=0;i<s.length();i++)
        {
            char ch=s.charAt(i);
            hash[ch]++;
            if(hash[ch]==1){
                //System.out.println(ch);
                int idx=s.lastIndexOf(ch);
                //System.out.println(idx);
                dp[idx]=1;
                //System.out.println(dp[idx]);
                open++;
            }
            //System.out.println(dp[i]);
            open=open-dp[i];
            //System.out.println(open);
            if(open>k)
            {
                flag=1;
                break;
            }
            open=open-dp[i];
        }
        if(flag==1)
        System.out.println("YES");
        else
        System.out.println("NO");
    }
}

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n  =scanner.nextInt();
		int m =scanner.nextInt();
		String string = scanner.next();
		char arr[] = string.toCharArray();
		Map<Character, Integer> map = new HashMap<>();
		Set<Character> set = new HashSet<>();
		for(int i =0;i<arr.length;i++) {
			map.put(arr[i], i);
		}
		int used= 0;
		for(int i =0;i<arr.length;i++) {
			if (set.contains(arr[i])) {
				if (map.get(arr[i])==i) {
					used -- ;
				}
			}else {
				used++;
				set.add(arr[i]);
				if (used>m) {
					System.out.println("YES");
					return;
				}
			}
		}
		System.out.println("NO");
	}
}

import java.util.Scanner;

public class azx
{

	public static void main(String[] args)
	{
		Scanner cin= new Scanner(System.in);
		int n=cin.nextInt();
		int k=cin.nextInt();
		String str=cin.next();
		int arr[]= new int[n+1];
		for (char c='A';c<'Z';c++)
		{
			if(str.indexOf(""+c)!=-1)
			{
			arr[str.indexOf(""+c)]+=1;
			arr[str.lastIndexOf(""+c)+1]+=-1;
			}
		}
		int min=0;
		for (int i = 1; i <arr.length; i++)
		{
			arr[i]=arr[i]+arr[i-1];
			if(arr[i]>min)
			{
				min=arr[i];
			}
		}
		if(k>=min)
		{
			System.out.println("NO");
		}
		else
		{
			System.out.println("YES");
		}
	}

}

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int k = sc.nextInt();
		sc.nextLine();
		String s = sc.nextLine();
		int [] num = new int[200];

		for (int i =0;i<n;i++)
		num[(int)s.charAt(i)]++;

		int count =0;
		boolean flag =true;
		boolean [] gate = new boolean[200];
		Arrays.fill(gate,false);

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

		    if(gate[(int)s.charAt(i)]==false)
		    {
		        gate[(int)s.charAt(i)]=true;
		        count++;
		    }
		    num[(int)s.charAt(i)]--;
		    if (gate[(int)s.charAt(i)]==true && num[(int)s.charAt(i)]==0)
		    {
		        gate[(int)s.charAt(i)]=false;
		        count--;
		    }

		    //System.out.println(count);
		    if(count>k)
		    {
		        flag=false;
		        break;
		    }
		}
		if(flag==true)
		System.out.println("NO");
		else
		System.out.println("YES");

		sc.close();
	}
}

import java.util.Scanner;

public class MainClass {
    public static Scanner input = new Scanner(System.in);
    public static int numberOfVisitorsForEachDoor[] = new int[26];
    public static boolean doorStatue[] = new boolean[26];
    public static int numberOfGuests, numberOfGuards;

    public static void openDoor(int index) {
        doorStatue[index] = true;
    }

    public static void closeDoor(int index) {
        doorStatue[index] = false;
    }

    public static int getNumberOfOpenedDoors() {
        int counter = 0;
        for (int i = 0; i < 26; i++) {
            if (doorStatue[i] == true) counter++;
        }
        return counter;
    }

    public static void main(String[] args) {
        numberOfGuests = input.nextInt();
        numberOfGuards = input.nextInt();
        String entranceSequence = new String(input.next());
        char entranceSequenceArray[] = entranceSequence.toCharArray();
        for (char i : entranceSequenceArray) numberOfVisitorsForEachDoor[i - 'A']++;
        for (char i : entranceSequenceArray) {
            openDoor(i - 'A');
            numberOfVisitorsForEachDoor[i - 'A']--;
            if (numberOfVisitorsForEachDoor[i - 'A'] == 0) closeDoor(i - 'A');
            if (getNumberOfOpenedDoors() > numberOfGuards) {
                System.out.println("YES");
                return;
            }
        }
        if (getNumberOfOpenedDoors() > numberOfGuards) {
            System.out.println("YES");
            return;
        }
        System.out.println("NO");
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author AEroui
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();

            char[] arr = in.next().toCharArray();
            int[] e = new int[26];
            Arrays.fill(e, Integer.MAX_VALUE);
            int[] s = new int[26];
            Arrays.fill(s, Integer.MIN_VALUE);

            for (int i = 0; i < arr.length; ++i) {
                char c = arr[i];
                e[c - 'A'] = Math.min(e[c - 'A'], i);
                s[c - 'A'] = Math.max(s[c - 'A'], i);
            }

            int cur = 0;
            for (int i = 0; i < n; ++i) {
                if (e[arr[i] - 'A'] == i) ++cur;
                if (s[arr[i] - 'A'] == i) --cur;
                //out.println(cur);
                if (cur > k) {
                    out.println("YES");
                    return;
                }
            }

            out.println("NO");

        }

    }
}

/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
public class S {
	public static void main (String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int k=in.nextInt();
		String s=in.next();
		Map<Character,Integer> map=new HashMap<>();
		for(int i=0;i<n;i++)
		{
		    if(!map.containsKey(s.charAt(i)))map.put(s.charAt(i),1);
		    else map.put(s.charAt(i),map.get(s.charAt(i))+1);
		}
		if(map.size()<=k)System.out.print("NO");
		else
		{
		    Map<Character,Integer> temp=new HashMap<>();
		    int flag=0;
		    for(int i=0;i<n;i++)
		    {
		        if(!temp.containsKey(s.charAt(i)))temp.put(s.charAt(i),1);
		        else temp.put(s.charAt(i),temp.get(s.charAt(i))+1);

		        if(temp.get(s.charAt(i))==map.get(s.charAt(i)))
		        {
		            temp.remove(s.charAt(i));
		        }
		        if(temp.size()>k)
		        {
		            flag=1;
		            break;
		        }
		    }
		    if(flag==1)System.out.print("YES");
		    else System.out.print("NO");
		}
	}
}

import java.util.Arrays;
import java.util.BitSet;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main{
	static Scanner s=new Scanner(System.in);
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static IntStream INS(int n) {return REPS(n).map(i->getInt());}
	static int getInt(){return Integer.parseInt(s.next());}

	public static void main(String[]$){
		int[]c=new int[26];
		Arrays.fill(c,-1);

		BitSet b=new BitSet();

		int n=getInt(),k=getInt();
		char[]in=s.next().toCharArray();

		for(int i=0;i<n;++i) {
			if(c[in[i]-'A']==-1||c[in[i]-'A']==i-1) {
				c[in[i]-'A']=i;
			}else{
				b.set(in[i]-'A');
			}
		}
		System.out.println(b.cardinality()>k?"YES":"NO");
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Reader in = new Reader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Reader in, PrintWriter out) {
            int[] ent = new int[26];
            int[] dp = new int[26];
            int g = in.nextInt();
            int k = in.nextInt();

            char[] guests = in.nextString().toCharArray();
            for (int i = 0; i < g; i++) {
                ent[guests[i] - 'A']++;
            }

            int n = 0;
            int i = 0;
            for (i = 0; i < g; i++) {
                dp[guests[i] - 'A'] += 1;
                if (dp[guests[i] - 'A'] == 1) {
                    //first Occ.
                    n += 1;
                }
                if (dp[guests[i] - 'A'] == ent[guests[i] - 'A']) {
                    n -= 1;
                }
                if (n > k) {
                    out.println("YES");
                    break;
                }
            }
            if (i == g) {
                out.println("NO");
            }

        }

    }

    static class Reader {
        private InputStream mIs;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public Reader() {
            this(System.in);
        }

        public Reader(InputStream is) {
            mIs = is;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = mIs.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}

import java.util.*;
public class theFestiveEvening {
        public static String gaurdsRequired(String g,int k) {
                int discontinuity=0;
                int distinct=0;
                for(int i=0; i<g.length()-1; i++) {
                        if(g.charAt(i)!=g.charAt(i+1)) discontinuity++;
                }
                HashSet<Character> h = new HashSet<Character>();
                for(int i=0;i<g.length();i++) {
                        h.add(g.charAt(i));
                }
                distinct=h.size();
                int res= discontinuity < distinct ? discontinuity : distinct;
                if(distinct == g.length()) {
                        res = distinct;
                }
                if(res <= k || res==g.length()) {
                        return "NO";
                }
                else
                        return "YES";
        }
        public static void main(String[] args) {
                Scanner input = new Scanner(System.in);
                String[] nk = input.nextLine().split(" ");
                int n = Integer.parseInt(nk[0]);
                int k = Integer.parseInt(nk[1]);
                String g = input.nextLine();
                String res = gaurdsRequired(g, k);
                System.out.println(res);
        }
}

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int k = sc.nextInt();
		sc.nextLine();
		String s = sc.nextLine();
		int [] num = new int[200];
		//if(k==0)
		for (int i =0;i<n;i++)
		num[(int)s.charAt(i)]++;

		int [] count = new int[n+1];
		boolean flag =true;
		//boolean [] gate = new boolean[200];
	//	Arrays.fill(gate,false);
		count[0]=0;
		int [] c = new int[200];

		for (int i =1;i<=n;i++)
		{
		    if(c[(int)s.charAt(i-1)]==0)
		    {
		        count[i]=count[i-1]+1;
		    }
		    //System.out.println(count[i]);
		     if(count[i]>k)
		    {
		        flag=false;
		        break;
		    }
		    c[(int)s.charAt(i-1)]+=1;
		    if(c[(int)s.charAt(i-1)]==num[(int)s.charAt(i-1)])
		    count[i]--;

		}
		if(flag==true)
		System.out.println("NO");
		else
		System.out.println("YES");

		sc.close();
	}
}

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    private static String getPartyStatus(char[] guests, Map<Character, Integer> map, int guardCount) {
        int availableGuards = guardCount;
        Map<Character, Integer> enteredGuests = new HashMap<>(26);
        Integer cnt = 0;
        for (char enteringGuest : guests) {
            cnt = enteredGuests.get(enteringGuest);
            if (cnt == null) {
                --availableGuards;
                cnt = 0;
            }
            enteredGuests.put(enteringGuest, ++cnt);
            if (enteredGuests.get(enteringGuest).equals(map.get(enteringGuest))) {
                ++availableGuards;
            }
            if (availableGuards < 0) {
                return "YES";
            }
        }
        return "NO";
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int guardCount = scanner.nextInt();
        Map<Character, Integer> map = new HashMap<>(26);
        String guestSequence = scanner.next();
        Integer curCharCount = 0;
        for (char i : guestSequence.toCharArray()) {
            curCharCount = map.get(i);
            if (curCharCount != null) {
                map.put(i, curCharCount + 1);
            } else {
                map.put(i, 1);
            }
        }
        System.out.println(getPartyStatus(guestSequence.toCharArray(), map, guardCount));
        scanner.close();
    }
}

import com.sun.source.tree.Tree;

import java.io.*;
import java.util.*;

public class Main1 implements Runnable {

    long m = (int)1e9+7;
    PrintWriter rw;
    ArrayList<Integer> prime;
    boolean is_prime[];
    InputReader sc;
    public void run() {
        sc = new InputReader(System.in);
        rw = new PrintWriter(System.out);

        int n = sc.nextInt();
        int guards = sc.nextInt();
        String s = sc.next();
        int count = 0;
        boolean flag = false;
        HashMap<Character, Integer> hashMap1 = new HashMap<>();
        HashMap<Character, Integer> hashMap2 = new HashMap<>();
        for(int i = 0; i < n; i++){
            if(hashMap1.containsKey(s.charAt(i))){
                hashMap1.put(s.charAt(i), hashMap1.get(s.charAt(i)) + 1);
            } else {
                hashMap1.put(s.charAt(i), 1);
            }
        }
        for(int i = 0; i < n; i++){
            if(hashMap1.get(s.charAt(i)) >= 1){
                if(!hashMap2.containsKey(s.charAt(i))){
                    hashMap2.put(s.charAt(i), 1);
                    count++;
                    if(count > guards){
                        flag = true;
                        break;
                    }
                    hashMap1.put(s.charAt(i), hashMap1.get(s.charAt(i)) - 1);
                    if(hashMap1.get(s.charAt(i)) == 0){
                        count--;
                    }
                }
            }
        }
        if(flag){
            rw.print("YES");
        }else{
            rw.print("NO");
        }
        rw.close();
    }

    private static int maxIndex(List<Integer> list) {
        Integer i=0, maxIndex=-1, max=null;
        for (Integer x : list) {
            if ((x!=null) && ((max==null) || (x>max))) {
                max = x;
                maxIndex = i;
            }
            i++;
        }
        return maxIndex;
    }

    public int[] merge(int[] left, int[] right, int[] a){
        int nLeft = left.length;
        int nRight = right.length;
        int i = 0, j = 0, k = 0;
        while(i < nLeft && j < nRight) {
            if (left[i] <= right[j]) {
                a[k] = left[i];
                k++;
                i++;
            } else {
                a[k] = right[j];
                k++;
                j++;
            }
        }
        while (i < nLeft) {
            a[k] = left[i];
            i++;
            k++;
        }
        while (j < nRight) {
            a[k] = right[j];
            j++;
            k++;
        }
        return a;
    }

    public int[] mergeSort(int[] a){
        int n = a.length;
        if(n < 2){
            return a;
        }
        int mid = n/2;
        int[] left = new int[mid];
        int[] right = new int[n-mid];
        for(int i = 0; i < mid; i++){
            left[i] = a[i];
        }
        for(int i = mid; i < n; i++){
            right[i-mid] = a[i];
        }
        mergeSort(left);
        mergeSort(right);
        merge(left,right,a);
        return a;
    }

    static int largest(int[] arr) {
        int i;
        int max = arr[0];
        for (i = 1; i < arr.length; i++)
            if (arr[i] > max)
                max = arr[i];
        return max;
    }

    static long gcd(long a, long b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }
    void sieve(int n) {
        is_prime = new boolean[n+10];
        prime = new ArrayList<>();
        for(int i=2;i<=n;i++)
            is_prime[i] = true;

        for (int i = 2; i <= n; ++i) {
            if (is_prime[i]) prime.add(i);
            for (int j = 0; j < prime.size () && i * prime.get(j) < n; ++j) {
                is_prime[i * prime.get(j)] = false;
                if (i % prime.get(j) == 0) break;
            }
        }
    }
    public static void sortbyColumn(int arr[][], int col){
        Arrays.sort(arr, new Comparator<int[]>()
        {
            public int compare(int[] o1, int[] o2){
                return(Integer.valueOf(o1[col]).compareTo(o2[col]));
            }
        });

    }
    public static class DJSet {
        public int[] upper;

        public DJSet(int n) {
            upper = new int[n];
            Arrays.fill(upper, -1);
        }

        public int root(int x) {
            return upper[x] < 0 ? x : (upper[x] = root(upper[x]));
        }

        public boolean equiv(int x, int y) {
            return root(x) == root(y);
        }

        public boolean union(int x, int y) {
            x = root(x);
            y = root(y);
            if (x != y) {
                if (upper[y] < upper[x]) {
                    int d = x;
                    x = y;
                    y = d;
                }
                upper[x] += upper[y];
                upper[y] = x;
            }
            return x == y;
        }
    }
    public static int[] radixSort(int[] f)    {
        int[] to = new int[f.length];
        {
            int[] b = new int[65537];
            for(int i = 0;i < f.length;i++)b[1+(f[i]&0xffff)]++;
            for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
            for(int i = 0;i < f.length;i++)to[b[f[i]&0xffff]++] = f[i];
            int[] d = f; f = to;to = d;
        }
        {
            int[] b = new int[65537];
            for(int i = 0;i < f.length;i++)b[1+(f[i]>>>16)]++;
            for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
            for(int i = 0;i < f.length;i++)to[b[f[i]>>>16]++] = f[i];
            int[] d = f; f = to;to = d;
        }
        return f;
    }

    public void printArray(int[] a){
        for(int i=0;i<a.length;i++)
            rw.print(a[i]+" ");
        rw.println();
    }
    public int[] scanArrayI(int n){
        int[] a = new int[n];
        for(int i=0;i<n;i++)
            a[i] = sc.nextInt();
        return a;
    }

    public int[][] scan2dArrayI(int n, int m){
        int [][] a = new int[n][m];
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                a[i][j] = sc.nextInt();
            }
        }
        return  a;
    }
    public void print2dArrayI(int[][] a){
        for(int i = 0; i < a.length; i++){
            for(int j = 0; j < a.length; j++){
                rw.print(a[i][j] + " ");
            }
            rw.println();
        }
    }
    public long[] scanArrayL(int n){
        long[] a = new long[n];
        for(int i=0;i<n;i++)
            a[i] = sc.nextLong();
        return a;
    }
    public void printArray(long[] a){
        for(int i=0;i<a.length;i++)
            rw.print(a[i]+" ");
        rw.println();
    }
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt() {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
            return res * sgn;
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return readString();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    public static void main(String args[]) throws Exception {
        new Thread(null, new Main1(),"Main",1<<26).start();
    }
}

import java.util.*;
public class solution
{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        String s=sc.next();
        char[] c=s.toCharArray();
        int[] a=new int[10000000];
        boolean[] b=new boolean[26];
        for(int i=0;i<n;i++)
        {
        	int y=c[i]-'A';
        	a[y]=i;
        }
        int count=0;
        for(int i=0;i<n;i++)
        {
        	if(!b[c[i]-'A'])
        	{
        		b[c[i]-'A']=true;
        		count++;
        	}
        	if(a[c[i]-'A']==i)
        	{
        		count--;
        	}
        	if(count>k)
        	{
        		System.out.println("YES");
        		System.exit(0);
        	}
        }
        System.out.print("NO");
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author AEroui
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();

            char[] arr = in.next().toCharArray();
            int[] e = new int[26];
            Arrays.fill(e, Integer.MAX_VALUE);
            int[] s = new int[26];
            Arrays.fill(s, Integer.MIN_VALUE);

            for (int i = 0; i < arr.length; ++i) {
                char c = arr[i];
                e[c - 'A'] = Math.min(e[c - 'A'], i);
                s[c - 'A'] = Math.max(s[c - 'A'], i);
            }

            int cur = 0;
            for (int i = 0; i < n; ++i) {
                if (e[arr[i] - 'A'] == i) ++cur;
                else if (s[arr[i] - 'A'] == i) --cur;
                if (cur > k) {
                    out.println("YES");
                    return;
                }
            }

            out.println("NO");

        }

    }
}

import java.util.*;

public class Darshjava
{
    public static void main(String args [])
    {
        Scanner enter = new Scanner (System.in) ;
        int n = enter.nextInt() , k = enter.nextInt() , gates [] = new int [26] , deployed = 0 ;
        char letters [] = new char [26] ;
        String doors = enter.next() ;
        for (int i = 65 ; i <= 90 ; i++ )
            letters[i-65] = (char) i ;
        for (int j = 0 ; j < 26 ; j++)
            {
                if (doors.charAt(0) == letters[j]) gates[j] = 1 ;
            }
        for(int i = 1 ; i < doors.length() ; i++)
        {
            for (int j = 0 ; j < 26 ; j++)
                if (doors.charAt(i) == letters[j]
                   && doors.charAt(i-1) != doors.charAt(i))
                    switch (gates[j])
                    {
                        case 0 : gates[j] = 1 ; break ;
                        case 1 : gates[j] = 2 ; deployed++ ; break ;
                    }
            if (deployed > k && i != doors.length()-1)
            {System.out.println("YES"); System.exit(0);}
            else if (deployed >= k && i == doors.length()-1)
            {System.out.println("YES"); System.exit(0);}
        }
        System.out.println("NO");
    }
}

import java.util.*;

public class azx
{

	public static void main(String[] args)
	{
		Scanner cin= new Scanner(System.in);
		int n=cin.nextInt();
		int k=cin.nextInt();
		String str=cin.next();
		int arr[]= new int[n+1];
		for (char c='A';c<'Z';c++)
		{
			if(str.indexOf(""+c)!=-1)
			{
			arr[str.indexOf(""+c)]+=1;
			arr[str.lastIndexOf(""+c)+1]+=-1;
			}
		}
		int min=0;
		for (int i = 1; i <arr.length; i++)
		{
			arr[i]=arr[i]+arr[i-1];
			if(arr[i]>min)
			{
				min=arr[i];
			}
		}
		if(k>=min)
		{
			System.out.println("YES");
		}
		else
		{
			System.out.println("NO");
		}

	}

}

import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	private static FastScanner sc = new FastScanner();

	public static void main(String[] args) {
		int n = sc.nextInt();
		int k = sc.nextInt();
		char[] str = sc.next().toCharArray();

		int[] open = new int[n+1];

		boolean[] checked = new boolean[26];
		int cnt = 0;
		for(int i=0; i<n; i++) {
			if(!checked[str[i] - 'A']) {
				checked[str[i] - 'A'] = true;
				open[i]++;
				cnt++;
			}
			if(cnt == 26) break;
		}

		checked = new boolean[26];
		cnt = 0;
		for(int i=n-1; i>=0; i--) {
			if(!checked[str[i] - 'A']) {
				checked[str[i] - 'A'] = true;
				open[i+1]--;
				cnt++;
			}
			if(cnt == 26) break;
		}

		System.out.println(open[0]);
		for(int i=1; i<n; i++) {
			open[i] += open[i-1];
			System.out.println(open[i]);
		}

		for(int i=0; i<n; i++) {
			if(open[i] > k) {
				System.out.println("YES");
				return;
			}
		}

		System.out.println("NO");

	}

	static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
}

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[]a){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        sc.nextLine();
        String entrance = sc.nextLine();
        int[] doors = new int[26];
        int numDoors = 0;
        for(int i=0;i<n;i++){
            boolean first = i==0;
            if(doors[entrance.charAt(i)-'A'] == 0 && !first){
                numDoors++;
            }
            doors[entrance.charAt(i)-'A'] = i;
        }
        int[] openDoors = new int[26];
        int[] guards = new int[n];
        boolean yes = false;
        for(int i=0;i<guards.length;i++){
            if(openDoors[entrance.charAt(i)-'A'] == 0){
                openDoors[entrance.charAt(i)-'A'] ++;
            }
            if(doors[entrance.charAt(i)-'A']== i){
                openDoors[entrance.charAt(i)-'A'] = 0;
            }
            guards[i] += openDoors[entrance.charAt(i)-'A'];
            int sum = 0;
            for(int j=0;j<openDoors.length;j++){
                sum += openDoors[j];
            }
            if(sum > k){
                yes = true;
                break;
            }
        }
        System.out.println(yes? "YES" : "NO");
    }
}