#include <iostream>
#include <algorithm>
#include <queue>

using namespace std;

struct P{
	int x;
	int y;
};

struct St{
	P ln;
	P rn;
};

int xdir[4] = {0, 1, 0, -1}, ydir[4] = {1, 0, -1, 0};

bool bfs(char la[51][51], char ra[51][51], int w, int h, P len, P rin)
{
	bool f = false, vis[51][51][51][51];
	fill(&vis[0][0][0][0], &vis[50][50][50][50], true);
	St s, t;
	P l, r, u, v;
	queue<St> que;
	s.ln = len;
	s.rn = rin;
	que.push(s);
	vis[len.y][len.x][rin.y][rin.x] = false;
	while(!que.empty()){
		s = que.front();
		que.pop();
		l = s.ln;
		r = s.rn;
		if(la[l.y][l.x] == '%' && ra[r.y][r.x] == '%'){
			f = true;
			break;
		}
		if(la[l.y][l.x] == '%' || ra[r.y][r.x] == '%'){
			continue;
		}
		
		for(int i = 0; i < 4; i++){
			u.y = l.y+ydir[i];
			u.x = l.x+xdir[i];
			v.y = r.y+ydir[i];
			v.x = r.x-xdir[i];
			if(u.y < 0 || u.y >= h || u.x < 0 || u.x >= w){
				u.y = l.y;
				u.x = l.x;
			}
			if(la[u.y][u.x] == '#'){
				u.y = l.y;
				u.x = l.x;
			}
			if(v.y < 0 || v.y >= h || v.x < 0 || v.x >= w){
				v.y = r.y;
				v.x = r.x;
			}
			if(ra[v.y][v.x] == '#'){
				v.y = r.y;
				v.x = r.x;
			}
			if(vis[u.y][u.x][v.y][v.x]){
				vis[u.y][u.x][v.y][v.x] = false;
				t.ln = u;
				t.rn = v;
				que.push(t);
			}
		}
	}
	
	return f;
}

int main()
{
	int w, h;
	char ra[51][51], la[51][51];
	P rin, len;
	
	while(cin>>w>>h && (w+h)){
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				cin >> la[i][j];
				if(la[i][j] == 'L'){
					len.y = i;
					len.x = j;
				}
			}
			
			for(int j = 0; j < w; j++){
				cin >> ra[i][j];
				if(ra[i][j] == 'R'){
					rin.y = i;
					rin.x = j;
				}
			}
		}
		
		if(bfs(la, ra, w, h, len, rin)){
			cout << "Yes"<< endl;
		} else {
			cout << "No" << endl;
		}
	}
	
	return 0;
}