import java.io.*; import java.util.*; public class Main { static char[] values; static int[][] dp; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); values = sc.next().toCharArray(); int length = values.length; dp = new int[2][length]; if (dfw(0, length - 1) == 2) { System.out.println("Yes"); } else { System.out.println("No"); } } static int dfw(int level, int idx) { if (idx == 0) { return 1; } if (dp[level][idx] == 0) { if (level == 0) { if (values[idx] == '0') { dp[level][idx] = dfw(0, idx - 1); } else { dp[level][idx] = Math.min(dfw(1, idx - 1), dfw(0, idx - 1)) + 1; } } else { if (values[idx] == '1') { dp[level][idx] = dfw(1, idx - 1); } else { dp[level][idx] = Math.min(dfw(1, idx - 1), dfw(0, idx - 1)) + 1; } } } return dp[level][idx]; } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }