#include <bits/stdc++.h>
#include "algotester.h"
using namespace std;
string s = "Oh sh*t";
int main(int argc, char* argv[])
{
auto readers = initChecker(argc, argv);
auto test = readers[0];
auto user = readers[1];
auto ans = readers[2];
string u = user.readLine();
string a = ans.readLine();
user.readEof();
check(((u == s) == (a == s)), "wrong answer type");
if (u != s)
{
int n = test.readInt();
int k = test.readInt();
vector<int> A(n);
for (int i = 0; i < n; i++)
{
A[i] = test.readInt();
}
vector<int> U;
int x;
stringstream ss;
ss << u;
while (ss >> x)
U.push_back(x);
check((U.size() == A.size()), "wrong size");
int cnt = 1, mx = 1;
for (int i = 1; i < U.size(); i++)
{
if (U[i] == U[i - 1])
cnt++;
else
cnt = 1;
mx = max(mx, cnt);
}
check(mx >= k, "wrong answer");
sort(A.begin(), A.end());
sort(U.begin(), U.end());
check(A == U, "different output");
}
return 0;
}