import std.conv; import std.stdio; import std.string; void main(string[] args) { bool calc (int a, int b, int p) { immutable total = a + b; return total <= p && ( total == p || calc(a * 10 + 6, b, p) || calc(a * 10 + 7, b, p) || calc(a, b * 10 + 6, p) || calc(a, b * 10 + 7, p)); } ["No", "Yes"][calc(0, 0, readln.chomp.to!int)].writeln; }