Overlooking the captivating blend of myriads of vernal hues, Arkady the painter lays out a long, long canvas.

Arkady has a sufficiently large amount of paint of three colours: cyan, magenta, and yellow. On the one-dimensional canvas split into n consecutive segments, each segment needs to be painted in one of the colours.

Arkady has already painted some (possibly none or all) segments and passes the paintbrush to you. You are to determine whether there are at least two ways of colouring all the unpainted segments so that no two adjacent segments are of the same colour. Two ways are considered different if and only if a segment is painted in different colours in them.


-----Input-----

The first line contains a single positive integer n (1 ≤ n ≤ 100) — the length of the canvas.

The second line contains a string s of n characters, the i-th of which is either 'C' (denoting a segment painted in cyan), 'M' (denoting one painted in magenta), 'Y' (one painted in yellow), or '?' (an unpainted one).


-----Output-----

If there are at least two different ways of painting, output "Yes"; otherwise output "No" (both without quotes).

You can print each character in any case (upper or lower).


-----Examples-----
Input
5
CY??Y

Output
Yes

Input
5
C?C?Y

Output
Yes

Input
5
?CYC?

Output
Yes

Input
5
C??MM

Output
No

Input
3
MMY

Output
No



-----Note-----

For the first example, there are exactly two different ways of colouring: CYCMY and CYMCY.

For the second example, there are also exactly two different ways of colouring: CMCMY and CYCMY.

For the third example, there are four ways of colouring: MCYCM, MCYCY, YCYCM, and YCYCY.

For the fourth example, no matter how the unpainted segments are coloured, the existing magenta segments will prevent the painting from satisfying the requirements. The similar is true for the fifth example.

Difficulty: interview

Starter code:

Solutions:
input()
s = input()

if 'MM' in s or 'YY' in s or 'CC' in s:
    print ('No')
elif s.startswith('?') or s.endswith('?'):
    print ('Yes')
elif '??' in s:
    print ('Yes')
elif 'C?C' in s or 'M?M' in s or 'Y?Y' in s:
    print ('Yes')
else:
    print ('No')

n = int(input())
a = input()
for i in range(1,n):
    if a[i] == a[i-1] and a[i] != '?':
        print('No')
        return

for i in range(n):
    if a[i] == '?':
        if i ==0 or i == n-1:
            print('Yes')
            return
        elif a[i-1] == '?' or a[i+1] == '?':
                print('Yes')
                return
        else:
            if a[i-1] == a[i+1]:
                print('Yes')
                return
print('No')

n = int(input())
a= input()
f = 0
for i in range(n-1):
    if( a[i] == a[i+1] )and(a[i]!='?'):
        f = 1
        break
if f:print('No')
else:
    o = a[0]
    for i in range(1,n-1):
        if a[i] == '?':
            if (a[i-1]!= '?')and(a[i+1]!='?')and(a[i-1]!=a[i+1]):
                o += 'X'
            else:o+=a[i]
        else:
            o+=a[i]
    o +=a[-1]
    #print(o)
    if '?' in o:print('Yes')
    else:print('No')


while True:
    n=int(input())
    s=input()

    for i in range(0, n-1):
        if s[i]==s[i+1] and s[i]!='?':
            print('No')
            break

    else:
        if '??' in s or 'Y?Y' in s or 'C?C' in s or 'M?M' in s or s[0]=='?' or s[-1]=='?':
            print('Yes')
        else:
            print('No')

    break


n=int(input())
ch=input()
if ('CC' in ch)or ('MM' in ch) or ('YY' in ch):
      print("No")
else :
      if '??' in ch:
            print("Yes")
      else:
            if ch[0]=='?':
                  print("Yes")
            elif ch[n-1]=='?':
                  print("Yes")
            elif '?' not in ch:
                  print("No")
            else:
                  x=False
                  for i in range(1,len(ch)-1):
                        if ch[i]=='?':
                              if ch[i-1]==ch[i+1]:
                                    x=True
                                    break
                  if x:
                        print("Yes")
                  else:
                        print("No")
      


n = int(input())
canvas = input()

unknown_status = False
if canvas[0] == '?' or canvas[-1] == '?':
    unknown_status = True
for i in range(1, n-1):
    if canvas[i] == '?':
        if canvas[i+1] == '?':
            unknown_status = True
            break
        elif canvas[i-1] == canvas[i+1]:
            unknown_status = True
            break

adjust_status = True
for i in range(n-1):
    if canvas[i] == canvas[i+1] and canvas[i] != '?':
        adjust_status = False
        break

print("Yes" if unknown_status and adjust_status else "No")


n = int(input())
s = '?' + input() + '?'

flag = False
for x in range(1, len(s) - 1):    
    if s[x] == '?':
        k = 0
        for y in ['C', 'Y', 'M']:
            if s[x - 1] != y and s[x + 1] != y:
                k += 1
        if k > 1:
            flag = True
    elif s[x - 1] == s[x] or s[x + 1] == s[x]:
        flag = False
        break

if flag:
    print("Yes")
else:
    print("No")


n = int(input())
s = input()

if ((s.find('??') >= 0 or s[0] == '?' or s[-1] == '?'
    or any(s.find(c + '?' + c) >= 0 for c in ['C', 'M', 'Y']))
    and all(s.find(x) < 0 for x in ['CC', 'MM', 'YY'])):
    print("Yes")
else:
    print("No")


def run():
    input()
    s = input()

    for i in range(len(s)):

        if s[i] != '?':
            if i > 0 and s[i-1] == s[i]:
                return False
            if i < len(s) - 1 and s[i+1] == s[i]:
                return False
            continue

    for i in range(len(s)):
        if s[i] != '?': continue
        if i == 0:
            return True
        if i == len(s) -1:
            return True

        if s[i-1] == s[i] or s[i+1] == s[i]:
            return True

        if s[i-1] == s[i+1]:
            return True

    return False
print('Yes' if run() else 'No')

arri = lambda: [int(s) for s in input().split()]
arrf = lambda: [float(s) for s in input().split()]

n = int(input())
s = input()
l = '?'
flag = True
for c in s:
    if l == c and c != '?':
        flag = False
    l = c
cnt = 0
for i in range(1, n - 1):
    if s[i] == '?' and s[i - 1] != '?' and s[i+1] != '?' and s[i - 1] != s[i + 1]:
        cnt += 1
if cnt == s.count('?'):
    flag = False
print('Yes' if flag else 'No')


#lst = [1,2,3,4,5]
#print(" ".join(list(map(str, lst))))

N = int(input())
S = input()

if N == 1:
    if S == "?":
        print("Yes")
        quit()
    else:
        print("No")
        quit()

for i in range(N-1):
    char1 = S[i]
    char2 = S[i+1]
    if char1 == char2 and char1 != "?":
        print("No")
        quit()

if S.count("?") == 0:
    print("No")
    quit()

for i in range(N-1):
    char1 = S[i]
    char2 = S[i+1]
    if char1 == char2:
        print("Yes")
        quit()

if S[0] == "?" or S[N-1] == "?":
    print("Yes")
    quit()

for i in range(1, N-1):
    if S[i] == "?" and S[i-1] == S[i+1]:
        print("Yes")
        quit()

print("No")

n = int(input())
s = input()
n = len(s)
dp = [[0,0,0] for _ in range(n)]

if s[0] == "C":
    dp[0][0] = 1
if s[0] == "M":
    dp[0][1] = 1
if s[0] == "Y":
    dp[0][2] = 1
if s[0] == "?":
    dp[0][0] = 1
    dp[0][1] = 1
    dp[0][2] = 1

for i,c in enumerate(s[1:]):
    if c == "C":
        dp[i+1][0] += dp[i][1] + dp[i][2]
    if c == "M":
        dp[i+1][1] += dp[i][0] + dp[i][2]
    if c == "Y":
        dp[i+1][2] += dp[i][0] + dp[i][1]
    if c == "?":
        dp[i+1][0] += dp[i][1] + dp[i][2]
        dp[i+1][1] += dp[i][0] + dp[i][2]
        dp[i+1][2] += dp[i][0] + dp[i][1]

if sum(dp[-1])>1:
    print('Yes')
else:
    print('No')


n = int(input())
s = input()
ind = True
ind1 = False
y = []
for i in s:
	y.append(i)
for i in range(n):
	if (y[i] == "?" and i == 0) or (y[i] == "?" and i == n - 1) or (y[i] == "?" and y[i - 1] == y[i + 1]) or (y[i] == "?" and (y[i - 1] == "?" or y[i + 1])) == "?":
		ind1 = True
	if i > 0 and (y[i] == y[i - 1] and y[i] != "?"):
		ind = False
		break
if ind and ind1:
	print("Yes")
else:
	print("No")	


n=int(input())
s=input()
ans = 0
for i in range(1,n):
  if(s[i-1]==s[i] and (s[i]!='?')):
    ans=-1
    break
if(ans==-1):
  print("No")
else:
  ans = 1
  for i in range(n):
    if(s[i]=='?'):
      if(i-1>=0 and i+1<n):
        if((s[i-1]=='C' and s[i+1]=='Y') or (s[i-1]=='Y' and s[i+1]=='C')or (s[i-1]=='Y' and s[i+1]=='M')or (s[i-1]=='M' and s[i+1]=='Y')or (s[i-1]=='M' and s[i+1]=='C')or (s[i-1]=='C' and s[i+1]=='M')):
          ans=ans*1
        else:
          ans=ans*2
      else:
        ans = ans*2
  if(ans>1):
    print("Yes")
  else:
    print("No")

#!/usr/bin/env python3
from sys import stdin, stdout

def rint():
    return list(map(int, stdin.readline().split()))
#lines = stdin.readlines()

n = int(input())

s = input()
s = "".join(["?", s, "?"])
#print(s)
flag = 0
for i in range(1,n+1):
    if s[i] is not "?":
        if s[i] is s[i-1] or s[i] is s[i+1]:
            print("No")
            return
    else:
        if s[i-1] is s[i+1]:
            flag = 1
        elif s[i-1] is "?" or s[i+1] is "?":
            flag = 1

if flag:
    print("Yes")
else:
    print("No")


n = int(input())
s = input().rstrip()
notpaint = []
flg = True
for i in range(n):
    if i < n-1 and s[i] != '?':
        if s[i] == s[i+1]:
            flg = False
            break
    if s[i] == '?':
        notpaint.append(i)
if flg:
    work = 1
    for q in notpaint:
        if 0 == q or n-1 == q:
            work *= 2
        else:
            if s[q-1] == s[q+1] or s[q-1] == '?' or s[q+1] == '?':
                work *= 2
    if work > 1:
        print('Yes')
    else:
        print('No')
else:
    print('No')

n = int(input())
s = input()
x = False
dup = False
for i in range(0,n-1):
    if s[i]==s[i+1] and s[i]!='?':
        dup = True
        break
for i in range(0,n):
    if x:
        break
    if s[i]=='?':
        if i==0:
            x = True
            continue
        elif i==n-1:
            x = True
            continue
        else:
            a = s[i-1]
            b = s[i+1]
            if a=='?' or b=='?':
                x = True
                continue
            elif a==b:
                x = True
                continue
            else:
                continue
if dup:
    print("No")
elif x:
    print("Yes")
else:
    print("No")


n = int(input())
a = list(input()) + ['?']
f = False
for i in range(1, n):
	if a[i] == a[i - 1] and a[i] != '?':
		f = True
		break
if f:
	print('No')
	return
for i in range(n):
	if a[i] == '?':
		if a[i - 1] == a[i + 1] or a[i - 1] == '?' or a[i + 1] == '?':
			print('Yes')
			return
print('No')

n=int(input())
s=input()
flag=0
for i in range(n-1):
    if s[i]=='?':
        if s[i-1]==s[i+1]:
            flag=1
            break
        if s[i+1]=='?':
            flag=1
            break
if s[0]=='?' or s[n-1]=='?':
    flag=1
for i in range(n-1):
    if s[i]!='?' and s[i+1]==s[i]:
        flag=0
        break
if flag==1:
    print("Yes")
else:
    print("No")
        
    


n = int(input())
s = input()

def f(s):
    for i in range(len(s) - 1):
        if s[i] != '?':
            if s[i] == s[i + 1]:
                return False
    for i in range(len(s)):
        if s[i] == '?':
            if i == 0 or i == len(s) - 1:
                return True
            else:
                if s[i + 1] == '?':
                    return True
                if s[i - 1] == s[i + 1]:
                    return True
    return False

if f(s):
    print("Yes")
else:
    print("No")


def f(s):
    for i in range(len(s) - 1):
        if s[i] != '?' and s[i] == s[i + 1]:
            return False
    if s[0] == '?' or s[-1] == '?':
        return True
    for i in range(len(s) - 1):
        if s[i + 1] == s[i] == '?':
            return True
    for i in range(1, len(s) - 1):
        if s[i] == '?' and s[i - 1] == s[i + 1]:
            return True
    return False
input()
s = input()
if f(s):
    print("Yes")
else:
    print("No")

n = int(input())
s = input()
s = '*' + s
s += '#'
yes = 0
if s[1] == '?' or s[n] == '?':
    yes = 1

for i in range(1, n + 2 - 1):
    #print(s[i], i)
    if (s[i] == '?'):
        if ((s[i - 1] != s[i + 1]) == False or s[i - 1] == '?' or s[i + 1] == '?'):
            yes = 1
    elif s[i] == s[i - 1]:
        print('No')
        break
else:
    if yes:
        print('Yes')
    else:
        print('No')

cc = int(input())
dd = input()
flag=0
for i in range(1,cc):
    if dd[i]!='?' and dd[i]==dd[i-1]:
        print("No")
        flag=1
        break
if flag==0:
    if dd[0]=='?':
        print("Yes")
    elif dd[cc-1]=='?':
        print("Yes")
    else:
        count = 1
        flag =1
        for i in range(0,cc):
            if dd[i]=="?":
                if dd[i+1]=="?":
                    print("Yes")
                    flag=0
                    break
                else:
                    if dd[i-1]==dd[i+1]:
                        print("Yes")
                        flag=0
                        break
        if flag==1:
            print("No")


n = int(input())
s = input()
for i in range(1, n):
    if s[i - 1] == s[i] and s[i] != '?':
        print('No')
        return
for i in range(1, n):
    if s[i - 1] == '?' and s[i] == '?':
        print('Yes')
        return
for i in range(1, n - 1):
    if s[i - 1] == s[i + 1] and s[i] == '?':
        print('Yes')
        return
if s[0] == '?' or s[-1] == '?':
    print('Yes')
else:
    print('No')