N=int(input()) S=input() for i in range(0,N): n=S.split(S[i]) if len(n)>=3: print('Yes') else: print('No')