#include int main(void) { long n,m,a[3]={0,1},i,j; scanf("%ld%ld",&n,&m); if(2>n)printf("%ld",a[0]); else if(3>n)printf("%ld",a[1]); else{ for(i=2;i