Hello 2018
A
Modular Exponentiation
Codeforces
900
原题
←B →
翻译中…

The following problem is well-known: given integers $*n*$ and $*m*$, calculate

翻译中…

image,

翻译中…

where $2^{*n*} = 2·2·...·2$ ($*n*$ factors), and image denotes the remainder of division of $*x*$ by $*y*$.

翻译中…

You are asked to solve the "reverse" problem. Given integers $*n*$ and $*m*$, calculate

翻译中…

image.

翻译中…

Input

翻译中…

The first line contains a single integer $*n*$ ($1 ≤ *n* ≤ 10^{8}$).

翻译中…

The second line contains a single integer $*m*$ ($1 ≤ *m* ≤ 10^{8}$).

翻译中…

Output

翻译中…

Output a single integer — the value of image.

翻译中…

Note

翻译中…

In the first example, the remainder of division of 42 by $2^{4} = 16$ is equal to 10.

翻译中…

In the second example, 58 is divisible by $2^{1} = 2$ without remainder, and the answer is 0.

翻译中…

样例

Input #1
4
42
Output #1
10
InputCopy OutputCopy
Input #2
1
58
Output #2
0
InputCopy OutputCopy
Input #3
98765432
23456789
Output #3
23456789
InputCopy OutputCopy
题目信息
题号
913A
所属比赛
时间限制
1 s
内存限制
256 MB
标签
模拟
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。