import java.util.*; import java.math.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { String a = sc.next(); String b = sc.next(); int ai = 0; int bi = 0; try { ai = Integer.parseInt(a); bi = Integer.parseInt(b); } catch (Exception e) { System.out.println("NO"); return; } if ((a.length()!=1&&a.indexOf("0")==0)||(b.length()!=1&&b.indexOf("0")==0)) { System.out.println("NO"); return; } if (ai>12345||bi>12345) { System.out.println("NO"); return; } System.out.println("YES"); } }