function Main(input) {
	var str = input;
	var results = Array();
	var ans = 0;
	var c = 1;
	var sum = 0;
	var clc= 0;
	var arr = Array();
	var str = str.split("\n");
	var num1 = str[0].split(" ");
	var num2 = str[1].split(" ");
	var n = Number(num1[0]);	
	var k = Number(num1[1]);
	var s = Number(num1[2]);	
	var t = Number(num1[3]);
	var alen= num2.length;
	for(var i =0;i<alen;i++){
		arr[i] =Number(num2[i]);
		}
		console.log(arr)
	while(c<=k){
		console.log("c="+c);
		results = kumiawase(arr,c);
		console.log("res="+results);
		var reslen = results.length;
		for(j = 0;j<reslen;j++){
			sum =  results[j].reduce(function(a,b)
			{
				return a&b;
			}) 
			clc =  results[j].reduce(function(a,b)
			{
				return a^b;
			}) 
		if (sum==s && clc == t){
			ans ++;
			console.log(sum);
			console.log(clc);
			}
		}
		c++;
		sum =0;
		clc= 0;
	}
console.log(ans);
}
		
function kumiawase(balls, nukitorisu){
  var arrs, i, j, zensu, kumis;
  arrs = [];
  zensu = balls.length;
  if(zensu < nukitorisu){
    return;
  }else if(nukitorisu == 1){
    for(i = 0; i < zensu; i++){
      arrs[i] = [balls[i]];
    }
  }else{
    for(i = 0; i < zensu - nukitorisu + 1; i ++){
      kumis = kumiawase(balls.slice(i + 1), nukitorisu - 1);
      for(j = 0; j < kumis.length; j ++){
        arrs.push([balls[i]].concat(kumis[j]));
      }
    }
  }
  return arrs;
}

function toBit(num){
	num =  num.toString(2);
	num =  Number(num);
 	return num;
 }
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));