#include <bits/stdc++.h>

using namespace std;

int W, H;
bool reached[50][50][50][50];
bool wall[2][50][50];
int gx[2], gy[2];

typedef pair<int, int> P;

struct Node {
	int x1, y1, x2, y2;
};

int dx[4] = {0, 1, 0, -1};
int dy[4] = {-1, 0, 1, 0};

bool inRange(int x, int y) {
	return 0 <= x && x < W && 0 <= y && y < H;
}
bool isGoal(int id, int x, int y) {
	return x == gx[id] && y == gy[id];
}
bool isWall(int id, int x, int y) {
	if ( !inRange(x, y) ) return true;
	return wall[id][y][x];
}
P go(int id, int x, int y, int d) {
	int nx = x + dx[d], ny = y + dy[d];
	if ( isWall(id, nx, ny) ) return P(x, y);
	return P(nx, ny);
}

int main() {
	while ( cin >> W >> H, W || H ) {
		fill(&reached[0][0][0][0], &reached[0][0][0][0]+50*50*50*50, false);
		int sx[2], sy[2];
		for (int y = 0; y < H; ++y) {
			for (int i = 0; i < 2; ++i) {
				string str; cin >> str;
				for (int x = 0; x < W; ++x) {
					switch (str[x]) {
						case '.': wall[i][y][x] = false; break;
						case '#': wall[i][y][x] = true; break;
						case '%': wall[i][y][x] = false; gx[i] = x, gy[i] = y; break;
						case 'R':
						case 'L': wall[i][y][x] = false; sx[i] = x, sy[i] = y; break;
					}
				}
			}
		}
		queue<Node> Q; Q.push((Node){sx[0], sy[0], sx[1], sy[1]});
		reached[sx[0]][sy[0]][sx[1]][sy[1]] = true;
		while ( !Q.empty() ) {
			Node node = Q.front(); Q.pop();
			int x1 = node.x1, y1 = node.y1;
			int x2 = node.x2, y2 = node.y2;
			if ( !isGoal(0, x1, y1) && !isGoal(1, x2, y2) ) {
				for (int d = 0; d < 4; ++d) {
					int d1 = d, d2 = d % 2 == 0 ? d : (d+2)%4;
					P p1 = go(0, x1, y1, d1);
					P p2 = go(1, x2, y2, d2);
					int nx1 = p1.first, ny1 = p1.second;
					int nx2 = p2.first, ny2 = p2.second;
					if ( !reached[nx1][ny1][nx2][ny2] ) {
						reached[nx1][ny1][nx2][ny2] = true;
						Q.push((Node){nx1, ny1, nx2, ny2});
					}
				}
			}
		}
		if (reached[gx[0]][gy[0]][gx[1]][gy[1]]) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
}