long s=1,i;main(x){for(;~scanf("%d",&x);s=++i<3?s*x:s-x);puts(s?"NO":"YES");}