#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)

int cnt;
ll w,h;
char s1[60][60],s2[60][60];
int dp[60][60][60][60];
int que[50*50*50*50+10],quecnt;
int d4[]={0,1,0,-1,0};

int f(){
	h+=2;w+=2;
	{
		int li,lj,ri,rj;
		rep(i,0,h)rep(j,0,w){
			if(s1[i][j]=='L'){
				li=i;
				lj=j;
			}
			if(s2[i][j]=='R'){
				ri=i;
				rj=j;
			}
		}
		quecnt=0;
		dp[li][lj][ri][rj]=cnt;
		que[quecnt++]=li*55*55*55+lj*55*55+ri*55+rj;
	}
	rep(qqq,0,quecnt){
		int li=que[qqq]/55/55/55;
		int lj=que[qqq]/55/55%55;
		int ri=que[qqq]/55%55;
		int rj=que[qqq]%55;
		rep(k,0,4){
			int lii=li+d4[k];
			int ljj=lj+d4[k+1];
			int rii=ri+d4[k];
			int rjj=rj+d4[k+1];
			int flag=0;
			if(s1[lii][ljj]=='#'){
				lii=li;
				ljj=lj;
				flag++;
			}
			if(s2[rii][rjj]=='#'){
				rii=ri;
				rjj=rj;
				flag++;
			}
			if(flag==2)continue;
			if(dp[lii][ljj][rii][rjj]==cnt)continue;
			if(s1[lii][ljj]=='%'&&s2[rii][rjj]=='%')return 1;
			if(s1[lii][ljj]=='%'||s2[rii][rjj]=='%')continue;
			dp[lii][ljj][rii][rjj]=cnt;
			que[quecnt++]=lii*55*55*55+ljj*55*55+rii*55+rjj;
		}
	}
	return 0;
}

int main(){
	while(scanf("%lld%lld",&w,&h),w){
		++cnt;
		rep(i,0,h)scanf(" %s %s",s1[i+1]+1,s2[i+1]+1);
		rep(i,0,w+2)s1[0][i]=s1[h+1][i]=s2[0][i]=s2[h+1][i]='#';
		rep(i,0,h+2)s1[i][0]=s1[i][w+1]=s2[i][0]=s2[i][w+1]='#';
		rep(i,0,h)rep(j,0,w/2){
			char c=s2[i+1][j+1];
			s2[i+1][j+1]=s2[i+1][w-j];
			s2[i+1][w-j]=c;
		}
//		rep(i,0,h+2)puts(s1[i]);
//		puts("");
//		rep(i,0,h+2)puts(s2[i]);
		puts(f()?"Yes":"No");		
	}
}
