We call a 4-digit integer with three or more consecutive same digits, such as 1118, **good**.  You are given a 4-digit integer N. Answer the question: Is N **good**?
a,b,c,d=input();print('NYOE S'[a==b==c or b==c==d::2])
a,b,c,d=input()
print('NYoe s'[a==b==c or b==c==d::2])