import java.util.Scanner; public class yukicoderNo780 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int dansi = sc.nextInt(); int josi = sc.nextInt(); if( dansi + 1 <= josi ) { System.out.println( "YES" ); System.out.println( josi - dansi - 1 ); } else { System.out.println( "NO" ); System.out.println( dansi + 1 - josi ); } } }