#include <cstdio>
#include <queue>
#include <cstring>
using namespace std;

int w, h;
char f1[54][54], f2[54][54];
bool visit[54][54][54][54];
int dys[] = {-1, 0, 1, 0};
int dxs[] = {0, -1, 0, 1};

void trymove(const char f[][54], int &y, int &x, int dy, int dx){
	if(f[y + dy][x + dx] != '#'){
		y += dy;
		x += dx;
	}
}

bool solve(){
	memset(f1, '#', sizeof f1);
	memset(f2, '#', sizeof f2);
	memset(visit, 0, sizeof visit);

	int ly = -1, lx = -1, ry = -1, rx = -1;
	for(int i = 1; i <= h; ++i){
		scanf("%s%s", f1[i] + 1, f2[i] + 1);
		f1[i][w + 1] = f2[i][w + 1] = '#';
		
		for(int j = 1; j <= w; ++j){
			if(f1[i][j] == 'L'){
				ly = i;
				lx = j;
			}
			if(f2[i][j] == 'R'){
				ry = i;
				rx = j;
			}
		}
	}

	visit[ly][lx][ry][rx] = true;
	queue<int> q;
	q.push(ly << 24 | lx << 16 | ry << 8 | rx);
	while(!q.empty()){
		for(int i = 0; i < 4; ++i){
			ly = q.front() >> 24;
			lx = q.front() >> 16 & 0xff;
			ry = q.front() >> 8 & 0xff;
			rx = q.front() & 0xff;

			trymove(f1, ly, lx, dys[i], dxs[i]);
			trymove(f2, ry, rx, dys[i], dxs[(i + 2) & 3]);
			if(visit[ly][lx][ry][rx]){ continue; }
			visit[ly][lx][ry][rx] = true;
			int chk = (f1[ly][lx] == '%') + (f2[ry][rx] == '%');
			if(chk == 2){ return true; }
			if(chk == 0){
				q.push(ly << 24 | lx << 16 | ry << 8 | rx);
			}
		}
		q.pop();
	}
	return false;

}

int main(){
	while(scanf("%d%d", &w, &h), w){
		puts(solve() ? "Yes" : "No");
	}
}