A,B = parse.(Int,split(readline())) if A&~B != 0 print(0) else print(1<