P14529 [HackerRank] Superpowers
提高
题目描述

You will be given two integers $a,b$. You are required to output the result of $2^{(2^a)}$ mod $\boldsymbol{b}$.

Constraints

$1\leq a,b\leq10^6$

Input Format

First and only line of the input will contain two integers $a,b$ separated by a single blank space.

Output Format

Output the desired result in a single line.

Sample Input
2 7

Sample Output
2

Explanation

$2^a=4$, $2^{4}=16$, and $\mbox{16}$ mod $7$ is $2$.

输入格式

见题面

输出格式

见题面

样例输入
2 7
样例输出
2