Compute the number of ways to choose two subsets X,Y⊆2,3,…,n such that there does not exist x∈X,y∈Y such that x and y are not relatively prime. The sets X,Y may be empty. Output the number of ways modulo p.
The input contains the integer n and the modulo p separated by a space.
Output the number of ways to choose the subsets X,Y⊆2,3,…,n satisfying the condition above.