Competitions

# Reset the significant bits

Given integer а and positive integer k. Find the number that contains only the last k bits of а (i.e. reset all bits of а except the last k bits).

#### Input

One line contains two numbers a and k (0a109).

#### Output

Print the number a with reseted bits except the last k.

Time limit 1 second
Memory limit 64 MiB
Input example #1
5 1

Output example #1
1

Source 2010 LKSH Berendevy Polyany, August, Parallel C, Day 1, Problem E