// Croc Champ 2013 - Round 2 (Div. 2 Edition) B Ksusha the Squirrel
import java.io.*;
import java.math.*;
import java.util.*;
//Codeforces
public class MainCodeforces1 {
private static MyScanner in;
private static PrintStream out;
private static boolean LOCAL_TEST = false;
private static void solve() throws IOException
{
int N = in.nextInt();
int K = in.nextInt();
char[] c = in.nextString().toCharArray();
int maxAdjacentRocks = 0;
int nRock = 0;
if (c[0] == '#')
nRock = 1;
for (int i = 1; i < c.length; i++) {
if (c[i - 1] == '#')
nRock++;
else
nRock = 0;
maxAdjacentRocks = Math.max(maxAdjacentRocks, nRock);
}
if (maxAdjacentRocks < K)
out.println("YES");
else
out.println("NO");
}
public static void main(String[] args) throws IOException {
// helpers for input/output
out = System.out;
try {
String cname = System.getenv("COMPUTERNAME");
LOCAL_TEST = (cname.equals("ALPHA530"));
} catch (Exception e) {
}
if (LOCAL_TEST) {
in = new MyScanner("E:\\zin.txt");
}
else {
boolean usingFileForIO = false;
if (usingFileForIO) {
// using input.txt and output.txt as I/O
in = new MyScanner("input.txt");
out = new PrintStream("output.txt");
}
else {
in = new MyScanner();
out = System.out;
}
}
solve();
}
// =====================================
static class MyScanner {
Scanner inp = null;
public MyScanner() throws IOException
{
inp = new Scanner(System.in);
}
public MyScanner(String inputFile) throws IOException {
inp = new Scanner(new FileInputStream(inputFile));
}
public int nextInt() throws IOException {
return inp.nextInt();
}
public long nextLong() throws IOException {
return inp.nextLong();
}
public double nextDouble() throws IOException {
return inp.nextDouble();
}
public String nextString() throws IOException {
return inp.next();
}
}
}
No comments:
Post a Comment