#include<bits/stdc++.h>
using namespace std;
#define N 12
typedef struct PATH
{
int m;//地图数组的行下标
int n;//地图数组的列下标
PATH *next;
PATH *prev;
}PA;
PA *add(PA *head,int i,int j)//增加一个节点 记录AI的轨迹
{
PA *p,*pr=head;
p=(PA *)malloc(sizeof(PA));
if(p == NULL)
{
printf("Failed!\n");
exit(0);
}
if(head == NULL)
{
head=p;
}
else
{
while(pr->next!=NULL)
{
pr=pr->next;
}
pr->next=p;
p->prev=pr;
p->next=NULL;
}
p->m=i;
p->n=j;
return head;
}
PA *dl(PA *head,int *i,int *j)//碰壁 AI开始往回走 删除原先已建立节点 另寻他路
{
PA *pr=head,*p=NULL;
while(pr->next!=NULL)
{
pr=pr->next;
}
p=pr;
pr=pr->prev;
free(p);
pr->next=NULL;
*i=pr->m;
*j=pr->n;
return head;
}
int main()
{
char c;
int maze[N][N]={0};
int i,j;
for(i=1;i<N-1;i++)
{
for(j=1;j<N-1;j++)
{
scanf(" %c",&c);
if(c=='.')
{
maze[i][j]=0;
}
else
{
maze[i][j]=1;
}
}
}
for(i=0,j=1;j<N;j++)
maze[i][j]=1;
for(i=1,j=0;i<N;i++)
maze[i][j]=1;
for(i=N-1,j=1;j<N;j++)
maze[i][j]=1;
for(i=0,j=N-1;i<N;i++)
maze[i][j]=1;
i=1;j=1;//i代表行 j代表列
PA *head;
head=(PA*)malloc(sizeof(PA));
head->m=i;
head->n=j;
head->prev=NULL;
head->next=NULL;
while(i!=10 || j!=10)
{
if(maze[i][j+1]==0)//右移
{
maze[i][j]=1;
j++;
add(head,i,j);
maze[i][j]=1;
}
else if(maze[i+1][j]==0)//下移
{
maze[i][j]=1;
i++;
add(head,i,j);
maze[i][j]=1;
}
else if(maze[i][j-1]==0)//左移
{
maze[i][j]=1;
j--;
add(head,i,j);
maze[i][j]=1;
}
else if(maze[i-1][j]==0)//上移
{
maze[i][j]=1;
i--;
add(head,i,j);
maze[i][j]=1;
}
else if(maze[i+1][j]==1 && maze[i-1][j]==1 && maze[i][j+1]==1 && maze[i][j-1]==1)
{
maze[i][j]=1;
dl(head,&i,&j);
}
else if(i==1 && j==1)
{
printf("No");
return 0;
}
}
printf("Yes\n");
return 0;
}