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