
n = 7;
m = 2;

fi = (1 + (5 ** 0.5)) / 2
print  round((fi**n)/(5**0.5)) % m