Function to check if any such number exists
public static void ifNumberExists ( int X , int Y ) { int C , dsum ; C = X - Y - 1 ; dsum = factorize ( X ) ; if ( dsum >= C ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; }