import java.util.Scanner; public class No780 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int A = s.nextInt(); int B = s.nextInt(); s.close(); if(A + 1 <= B){ System.out.println("YES"); System.out.println("0"); }else{ System.out.println("NO"); System.out.println(A + 1 -B); } } }