The Little Elephant loves chess very much. 

One day the Little Elephant and his friend decided to play chess. They've got the chess pieces but the board is a problem. They've got an 8 × 8 checkered board, each square is painted either black or white. The Little Elephant and his friend know that a proper chessboard doesn't have any side-adjacent cells with the same color and the upper left cell is white. To play chess, they want to make the board they have a proper chessboard. For that the friends can choose any row of the board and cyclically shift the cells of the chosen row, that is, put the last (rightmost) square on the first place in the row and shift the others one position to the right. You can run the described operation multiple times (or not run it at all).

For example, if the first line of the board looks like that "BBBBBBWW" (the white cells of the line are marked with character "W", the black cells are marked with character "B"), then after one cyclic shift it will look like that "WBBBBBBW".

Help the Little Elephant and his friend to find out whether they can use any number of the described operations to turn the board they have into a proper chessboard.


-----Input-----

The input consists of exactly eight lines. Each line contains exactly eight characters "W" or "B" without any spaces: the j-th character in the i-th line stands for the color of the j-th cell of the i-th row of the elephants' board. Character "W" stands for the white color, character "B" stands for the black color.

Consider the rows of the board numbered from 1 to 8 from top to bottom, and the columns — from 1 to 8 from left to right. The given board can initially be a proper chessboard.


-----Output-----

In a single line print "YES" (without the quotes), if we can make the board a proper chessboard and "NO" (without the quotes) otherwise.


-----Examples-----
Input
WBWBWBWB
BWBWBWBW
BWBWBWBW
BWBWBWBW
WBWBWBWB
WBWBWBWB
BWBWBWBW
WBWBWBWB

Output
YES

Input
WBWBWBWB
WBWBWBWB
BBWBWWWB
BWBWBWBW
BWBWBWBW
BWBWBWWW
BWBWBWBW
BWBWBWBW

Output
NO



-----Note-----

In the first sample you should shift the following lines one position to the right: the 3-rd, the 6-th, the 7-th and the 8-th.

In the second sample there is no way you can achieve the goal.

Difficulty: interview

Starter code:

Solutions:
def go():
  for i in range(8):
    s = input()
    prv = 0
    for j in s:
      if j == prv: return False
      prv = j
  return True

print("YES" if go() else "NO")


def checkvalid(u, d):
    for i in range(8):
        cnt = 0;
        for j in range(8):
            if u[j] != d[i+j]:
                cnt += 1
            if j >= 1 and (u[j] == u[j-1] or d[i+j] == d[i+j-1]):
                cnt = 0
                break
        if cnt == 8:
            return True
    return False    

u = input()
d = input()
cnt = 2
isvalid = True

isvalid = checkvalid(u, d+d)
while cnt <= 7:
    cnt += 1
    u = d
    d = input()
    isvalid = isvalid and checkvalid(u, d+d)
if isvalid:
    print('YES')
else:
    print('NO')


ans="YES"
for i in range(8):
    s=input()
    if(s!=(s[0]+s[1])*4 or s[0]==s[1]):
        ans="NO"
print(ans)


import sys
f = sys.stdin
#f = open("input.txt", "r")
def solve():
    nonlocal f
    a = f.read().strip().split("\n")
    for l in range(8):
        count = 0
        for i in range(7):
            if a[l][i] == a[l][i+1]:
                count += 1
                if count >= 2:
                    print("NO")
                    return
    for l in range(1, 7):
        for i in range(1, 7):
            if a[l][i] == a[l+1][i] == a[l][i+1] == a[l+1][i+1]:
                print("NO")
                return
    else:
        print("YES")
        return
solve()

3

def readln(): return tuple(map(int, input().split()))

print('YES' if len([1 for _ in range(8) if input() in ['WB'*4, 'BW'*4]]) == 8 else 'NO')


yes = True
for i in range(8):
    s = input()
    if yes:
        for j in range(7):
            if s[j] == s[j + 1]:
                yes = False
                break
print("YES" if yes else "NO")



ans = 'YES'
for i in range(8):
    t = input()
    if t[0] == 'B':
        if t.count('BW') != 4:
            ans = 'NO'
            break
    else:
        if t.count('WB') != 4:
            ans = 'NO'
            break 
print(ans)

case=True

for i in range(8):
    s=input()
    if(s!="WBWBWBWB" and s!="BWBWBWBW"):
        case=False
if(case):
    print("YES")
else:
    print("NO")


proper = True
for i in range(8):
    raw = input()
    if raw != "WBWBWBWB" and raw != "BWBWBWBW":
        proper = False
if proper:
    print("YES")
else:
    print("NO")


cnt = 0
for i in range(8):
    s = input()
    if s == 'WB'*4 or s == 'BW'*4:
        cnt += 1
if cnt == 8: 
    print('YES')
else:
    print('NO')



c=0
for i in range(8):
    s=input()
    for j in range(len(s)-1):
        if s[j]==s[j+1]:
            c+=1
            break
if c==0:
    print('YES')
else:
    print('NO')


for i in range (8):
    s=input()
    if s!='BW'*4 and s!='WB'*4:
        print("NO")
        break
    if i==7:
        print('YES')

valid=True
for i in range(8):
    line=input()
    if line!='WBWBWBWB' and line!='BWBWBWBW':
        valid=False
if valid:
    print('YES')
else:
    print('NO')


board = []
for cont in range(0,8):
    board.append(input())
l = True
for row in board:
    for cont in range(0,7):
        if row[cont] == row[cont+1]:
            l = False
            break
    if l is False:
        break

if l:
    print('YES')
else:
    print('NO')

__copyright__ = ''
__author__ = 'Son-Huy TRAN'
__email__ = "sonhuytran@gmail.com"
__doc__ = ''
__version__ = '1.0'


def is_proper_chessboard(chessboard: list) -> bool:
    propers = ['WBWBWBWB', 'BWBWBWBW']

    for row in chessboard:
        if row != propers[0] and row != propers[1]:
            return False

    return True


def main() -> int:
    chessboard = []

    for _ in range(8):
        chessboard.append(input())

    print('YES' if is_proper_chessboard(chessboard) else 'NO')
    return 0


def __starting_point():
    exit(main())
__starting_point()

e=True
for i in range(8):
    a=input()
    if(a!='BW'*4)&(a!='WB'*4):
        e=False
        print('NO')
        break
if e:print('YES')


def good(s):
    for i in range(7, -1, -1):
        if s[i] == s[i-1]:
            return False
    return True
for i in range(8):
    if not good(input()):
        print('NO')
        return
print('YES')


for i in range(8):
    r = input()
    if r != 'WBWBWBWB' and r != 'BWBWBWBW':
        print('NO')
        return
print('YES')

lis=[]
for i in range(8):
    lis.append(input())
lis1=['WBWBWBWB','BWBWBWBW']
check=1
for i in range(8):
    if lis[i] not in lis1:
        check=0
if check==0:
    print('NO')
else:
    print('YES')
            


import sys
import math
  
for i in range(8):
    st = sys.stdin.readline()
    for j in range(7):
        if(st[j] == st[j + 1]):
            print("NO")
            return
print("YES")

for i in range(8):
	s = input()
	for a, b in zip(s, (s + s[0])[1: ]):
		if a == b:
			print('NO')
			return
print('YES')


def main():
    for _ in range(8):
        s = input()
        if not s[::2] == s[0] * 4 != s[1] * 4 == s[1::2]:
            print('NO')
            return
    print('YES')


def __starting_point():
    main()

__starting_point()

# coding: utf-8
for i in range(8):
    s = input()
    s1 = set([s[j] for j in range(8) if j%2==0])
    s2 = set([s[j] for j in range(8) if j%2==1])
    if len(s1)!=1 or len(s2)!=1 or s1==s2:
        print('NO')
        break
else:
    print('YES')


from re import *
def main():
    mode="filee"
    if mode=="file":f=open("test.txt","r")
    #f.readline()
    #input()
    get = lambda :[f.readline()[:-1] if mode=="file" else input()]
    for z in range(8):
        q=get()
        q=q[0]
        if search('BB',q)!=None or search('WW',q)!=None:
            print("NO")
            return
    print("YES")
    


    if mode=="file":f.close()


def __starting_point():
    main()

__starting_point()


def foo():
   table = []
   for i in range(8):
      table.append(input())

   w = 'W' * 4
   b = 'B' * 4
   for s in table:
      a1 = s[0:len(s):2]
      a2 = s[1:len(s):2]
      if not ((a1 == w and a2 == b)
         or (a1 == b and a2 == w)):
         print('NO')
         return
   print('YES')

foo()