import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.InputMismatchException; public class Hack52E{ void solve() { int n = ni(), k = ni(); int[] a = ia(n); for(int i=0;i>>1; int max = 1<<31; int or = 0; int and = -1; for(int j=l;j<=r;j++) { min = Math.min(min, a[j]); max = Math.max(max, a[j]); or |= a[j]; and &= a[j]; } int cost = or - and - max + min; if(cost >= k) size = Math.max(size, r - l + 1); } out.println(size); } } public static void main(String[] args){new Hack52E().run();} private byte[] bufferArray = new byte[1024]; private int bufLength = 0; private int bufCurrent = 0; InputStream inputStream; PrintWriter out; public void run() { inputStream = System.in; out = new PrintWriter(System.out); solve(); out.flush(); } int nextByte() { if(bufLength == -1) throw new InputMismatchException(); if(bufCurrent >= bufLength) { bufCurrent = 0; try {bufLength = inputStream.read(bufferArray);} catch(IOException e) { throw new InputMismatchException();} if(bufLength <= 0) return -1; } return bufferArray[bufCurrent++]; } boolean isSpaceChar(int x) {return (x < 33 || x > 126);} boolean isDigit(int x) {return (x >= '0' && x <= '9');} int nextNonSpace() { int x; while((x=nextByte()) != -1 && isSpaceChar(x)); return x; } int ni() { long ans = nl(); if (ans >= Integer.MIN_VALUE && ans <= Integer.MAX_VALUE) return (int)ans; throw new InputMismatchException(); } long nl() { long ans = 0; boolean neg = false; int x = nextNonSpace(); if(x == '-') { neg = true; x = nextByte(); } while(!isSpaceChar(x)) { if(isDigit(x)) { ans = ans * 10 + x -'0'; x = nextByte(); } else throw new InputMismatchException(); } return neg ? -ans : ans; } String ns() { StringBuilder sb = new StringBuilder(); int x = nextNonSpace(); while(!isSpaceChar(x)) { sb.append((char)x); x = nextByte(); } return sb.toString(); } char nc() { return (char)nextNonSpace();} double nd() { return (double)Double.parseDouble(ns()); } char[] ca() { return ns().toCharArray();} char[] ca(int n) { char[] ans = new char[n]; int p = 0; int x = nextNonSpace(); while(p