#include int main(void){ int a=0,b=0,c=0; scanf("%d %d",&a,&b); c=b-1; if(a<=c){ printf("YES\n%d",a-c); }else{ printf("NO\n0"); } return 0; }