You are given an array a of size n consisting of integers. Now, you need to find the number of distinct integers x, such that there exists a sequence of distinct indices i1<i2<...<im,1≤m≤k and a[i1] or a[i2] or ... or a[im]=x
Here or represents the bitwise OR operator.
Input
First line of the each input will contain two space seperated integers n and k denoting the size of the array and maximum size of the subset, respectively.
Next line will contain n spaced integers denoting elements of the array.
Constraint
1≤n≤1000
1≤k≤20
1≤a[i]≤2047
Output
Output will consists of a single integer denoting the number of unique integers that can be formed by taking Bitwise OR of every subset of size less than or equal to k.
Array is having 3 integers: 1, 2 and 4.
Subsets having size less than or equal to 2 is {{1},{2},{4},{1,2},{1,4},{2,4}}.
Bitwise OR of the subsets thus obtained is {1,2,4,3,5,6}.
Thus total unique intgers formed by taking bitwise OR of all subsets of size less than or equal to 2 is 6.