Frobenius coin problem#9615

Frobenius coin problem

1 second
128 megabytes
Easy

There are coins of two denominations and respectively. Find the largest sum that cannot be represented with these two denominations (assuming infinite supply of coins) and the total number of such not representable amounts. If such value does not exist, print NA.

Input

Two positive integers and y~(1 < x, y \le 10^9).

Output

Print in one line two numbers: and .

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading