#include "testlib.h"

using namespace std;

int const MAX_N = 1'000'000'000;
int const MAX_K = 200;

int main(int argc, char **argv) {
  registerValidation(argc, argv);
  int n = inf.readInt(1, MAX_N, "n");
  inf.readSpace();
  int k = inf.readInt(1, min(MAX_K, n), "k");
  inf.readSpace();
  int s = inf.readInt(1, n, "s");
  inf.readEoln();

  vector<int> qs = inf.readInts(k, 1, n, "q");
  inf.readEoln();
  bool foundS = false;
  for (int i = 0; i < k; i++) {
  	if (i > 0) {
  		ensuref(qs[i - 1] < qs[i], 
  			"Question indices are not increasing: q[%d] = %d, but q[%d] = %d", i - 1, qs[i - 1], i, qs[i]);
  	}
  	foundS |= qs[i] == s;
  }
  ensuref(foundS, "Didn't find s = %d among q", s);
  ensuref(n != 998244353, "n must not be equal to 998244353");
  inf.readEof();
  return 0;
}
