local str = io.read() local n = #str local t = {} for i = 1, n do t[i] = tonumber(str:sub(n + 1 - i, n + 1 - i)) end local ret = true local solo = false for i = 1, n - 1 do if 2 <= t[i] and t[i] <= 4 then if solo then ret = false break else t[i + 1] = t[i + 1] - 1 end elseif t[i] == 6 or t[i] == 7 then solo = true else ret = false break end end if ret then if t[n] == 0 or t[n] == 6 or t[n] == 7 then else ret = false end end print(ret and "Yes" or "No")