#include<iostream>
#include<cstdio>
#include<string.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
int min(int a,int b)
{
if(a<b)return a;else return b;
}
int main()
{
int m,n,k;
double fai=((sqrt(5.0)+1)/2);
while(scanf("%d%d",&n,&m)!=EOF)
{
k=abs(m-n);
if (min(m,n)==(int)(k*fai))printf("0\n");elseprintf("1\n");
}
return 0;
}