import sys s = [_ for _ in sys.stdin][0] sys.stdout.write("Yes\n" if any(len(set(s[k:k+9])) == 9 for k in range(len(s)-8)) else "No\n")