The Goldfish – Petryk's Second Wish#4634

The Goldfish – Petryk's Second Wish

1 second
64 megabytes
Hard

Recall Petryk, who once caught a golden fish at Vynnykiv Lake and made wishes. You might also remember the bee maze, which is depicted as follows:

Petryk starts in room number . As a bee, or more precisely, a bumblebee, he can move to any of the adjacent rooms in a single day. Room number contains the exit from the maze. It's possible for Petryk to start directly in the room with the exit.

Your task is to fulfill Petryk's second wish: calculate the number of ways Petryk can escape the maze in the fewest possible days.

Input

The input consists of two natural numbers separated by a space – and (1 \leq X, Y \leq 10^6).

Output

Output a single number: the number of ways Petryk Pyatochkin can escape the maze in the minimum number of days.

Examples

Example 1

Loading
Loading