At first, let's define function f(x) as follows: $$$ \begin{matrix} f(x) & = & \left\{ \begin{matrix} x/2 & \mbox{if } x  is even \\\ x - 1 & \mbox{otherwise } \end{matrix} \right. \end{matrix} $$$

We can see that if we choose some value v and will apply function f to it, then apply f to f(v), and so on, we'll eventually get 1. Let's write down all values we get in this process in a list and denote this list as path(v). For example, path(1) = [1], path(15) = [15, 14, 7, 6, 3, 2, 1], path(32) = [32, 16, 8, 4, 2, 1].

Let's write all lists path(x) for every x from 1 to n. The question is next: what is the maximum value y such that y is contained in at least k different lists path(x)?

Formally speaking, you need to find maximum y such that \left| \{ x ~|~ 1 ≤ x ≤ n, y ∈ path(x) \} \right| ≥ k.

Input

The first line contains two integers n and k (1 ≤ k ≤ n ≤ 10^{18}).

Output

Print the only integer — the maximum value that is contained in at least k paths.

Examples

Input


11 3


Output


5


Input


11 6


Output


4


Input


20 20


Output


1


Input


14 5


Output


6


Input


1000000 100


Output


31248

Note

In the first example, the answer is 5, since 5 occurs in path(5), path(10) and path(11).

In the second example, the answer is 4, since 4 occurs in path(4), path(5), path(8), path(9), path(10) and path(11).

In the third example n = k, so the answer is 1, since 1 is the only number occuring in all paths for integers from 1 to 20.
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.InputMismatchException;

public class E {
    final static int MOD = 1000000007;
    static long max = 1;
    static long cap = 1;
    static long[] powOf2 = new long[64];

    public static void main(String[] args) throws Exception {
        FastReader in = new FastReader(System.in);
        max = in.nextLong();
        cap = in.nextLong();

        if (max < 10) {
            System.out.println(bruteSearch());
            return;
        }

        long odd = binarySearch(1,  (max + 1L) / 2L * 2L - 1L);
        long even = binarySearch(2, max / 2L * 2L);
        long res = Math.max(odd, even);
        System.out.println(res);
    }

    private static long bruteSearch() {
        for (long i = max; i > 0; i--) {
            if (count(i) >= cap) {
                return i;
            }
        }
        return -1;
    }

    private static long binarySearch(long min, long max) {
        if (max == min + 2L) {
            long countMin = count(min);
            long countMax = count(max);
            if (countMax >= cap) {
                return max;
            } else if (countMin >= cap) {
                return min;
            } else {
                return -1;
            }
        }
        long avg = (max + min) / 2L;
        if (avg % 2 != min % 2) avg--;
        long countAvg = count(avg);
        if (countAvg < cap) {
            return binarySearch(min, avg);
        } else {
            return binarySearch(avg, max);
        }
    }

    private static long count(long n) {
        if (n % 2 == 0) {
            return countEven(n);
        } else {
            return countOdd(n);
        }
    }

    private static long countEven(long n) {
        long k = n / 2L;
        double mDouble = log2((double)max / (double)k);
        long m = (long) mDouble;
        //adjust m
        for (long i = m + 1; i >= 0; i--) {
            long beginLevelI = powOf2(i) * k;
            if (beginLevelI <= max) {
                m = i;
                break;
            }
        }

        long count = 0;
        for (int i = 1; i <= m; i++) {
            count += powOf2(i);
        }
        long endLevelM = powOf2(m) * k + powOf2(m) - 1;
        long lackLevelM = 0;
        if (max < endLevelM) {
            lackLevelM = Math.min(endLevelM - max, powOf2(m));
        }
        return count - lackLevelM;
    }

    private static long countOdd(long n) {
        if (n == 1) return max;
        long k = (n - 1L) / 2L;
        double mDouble = 1 + log2((double)max / ((double)k + 1D));
        long m = (long) mDouble;
        //adjust m
        for (long i = m + 1; i >= 0; i--) {
            long beginLevelI = powOf2(i) * k + powOf2(i - 1);
            if (beginLevelI <= max) {
                m = i;
                break;
            }
        }

        long count = 0;
        for (int i = 1; i <= m; i++) {
            count += powOf2(i - 1L);
        }
        long endLevelM = powOf2(m) * k + powOf2(m) - 1;
        long lackLevelM = 0;
        if (max < endLevelM) {
            lackLevelM = Math.min(endLevelM - max, powOf2(m - 1));
        }
        return count - lackLevelM;
    }

    private static long powOf2(long n) {
        if (powOf2[(int)n] == 0) {
            long res = 1;
            for (int i = 0; i < n; i++) {
                res *= 2L;
            }
            powOf2[(int)n] = res;
        }
        return powOf2[(int)n];
    }

    private static double log2(double x) {
        double log2 = Math.log(2);
        double logx = Math.log(x);
        return logx / log2;
    }

    static class FastReader {
        private boolean finished = false;

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }

            return buf[curChar++];
        }

        public int peek() {
            if (numChars == -1) {
                return -1;
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = read();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private String readLine0() {
            StringBuilder buf = new StringBuilder();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r') {
                    buf.appendCodePoint(c);
                }
                c = read();
            }
            return buf.toString();
        }

        public String nextLine() {
            String s = readLine0();
            while (s.trim().length() == 0)
                s = readLine0();
            return s;
        }

        public String nextLine(boolean ignoreEmptyLines) {
            if (ignoreEmptyLines) {
                return nextLine();
            } else {
                return readLine0();
            }
        }

        public BigInteger nextBigInteger() {
            try {
                return new BigInteger(nextString());
            } catch (NumberFormatException e) {
                throw new InputMismatchException();
            }
        }

        public char nextCharacter() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            return (char) c;
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E') {
                    return res * Math.pow(10, nextInt());
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E') {
                        return res * Math.pow(10, nextInt());
                    }
                    if (c < '0' || c > '9') {
                        throw new InputMismatchException();
                    }
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public boolean isExhausted() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value == -1;
        }

        public String next() {
            return nextString();
        }

        public SpaceCharFilter getFilter() {
            return filter;
        }

        public void setFilter(SpaceCharFilter filter) {
            this.filter = filter;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}
