using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[] NMi => ReadLine().Split().Select(c => int.Parse(c) - 1).ToArray(); static int[][] NMap(int n) => Enumerable.Repeat(0, n).Select(_ => NMi).ToArray(); static void Main() { var n = ReadLine(); var cnt = n.Count(c => c == '1'); if (cnt == 2) { WriteLine("Yes"); return; } if (cnt == 1) { WriteLine("No"); return; } for (var i = 0; i + 1 < n.Length; ++i) { if (n[i] == '0' && n[i + 1] == '1') { WriteLine("No"); return; } } WriteLine("Yes"); } }