A=input()+input()+input() B="#."*5 print('Yes' if A in B else 'No')