#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

const int MAX_W = 52;
const int MAX_H = 52;

char fieldL[MAX_H][MAX_W];
char fieldR[MAX_H][MAX_W];
bool G[52][52][52][52];

int main() {
	int w, h;
	while(cin >> w >> h, w|h){
		fill_n((char *)fieldL, MAX_W * MAX_H, '#');
		fill_n((char *)fieldR, MAX_W * MAX_H, '#');
		fill_n((bool *)G, MAX_W * MAX_H * MAX_W * MAX_H, false);

		pii ls, rs, lg, rg;
		REP(y, h){
			char c;
			REP(x, w){
				cin >> c;
				switch(c){
				case '%':
					c = '.';
					lg.first = x + 1;
					lg.second = y + 1;
					break;
				case 'L':
					c = '.';
					ls.first = x + 1;
					ls.second = y + 1;
					break;
				}
				fieldL[y + 1][x + 1] = c;
			}
			REP(x, w){
				cin >> c;
				switch(c){
				case '%':
					c = '.';
					rg.first = x + 1;
					rg.second = y + 1;
					break;
				case 'R':
					c = '.';
					rs.first = x + 1;
					rs.second = y + 1;
					break;
				}
				fieldR[y + 1][x + 1] = c;
			}
		}


//		LOG("%d %d ,, %d %d\n", ls.first, ls.second , rs.first, rs.second);

		queue<pair<pii, pii>> que;
		que.push({ls, rs});
		bool res = false;
		while(!que.empty()){
			pii L = que.front().first;
			pii R = que.front().second;
			que.pop();

			/*
			LOG("%d %d |||| %d %d\n", L.first, L.second , R.first, R.second);
			REP(y, h + 2){
				REP(x, w + 2){
					if(L.first == x && L.second == y)
						LOG("L");
					else
						LOG("%c", fieldL[y][x]);

				}
				LOG(" ");

				REP(x, w + 2){
					if(R.first == x && R.second == y)
						LOG("R");
					else
						LOG("%c", fieldR[y][x]);
				}
				LOG("\n");
			}
			LOG("------\n");
			*/

			if(L == lg){
				if(R == rg){
					res = true;
					break;
				}
				continue;
			}else if(R == rg) continue;

			REP(i, 4){
				pii nextL = {L.first + dx[i], L.second + dy[i]};
				pii nextR = {R.first - dx[i], R.second + dy[i]};
				if(fieldL[nextL.second][nextL.first] == '#'){
					nextL = L;
				}
				if(fieldR[nextR.second][nextR.first] == '#'){
					nextR = R;
				}

				//				LOG("%c %c   %d %d  <<<--- %d %d\n", fieldL[nextL.second][nextL.first],fieldR[nextR.second][nextR.first], nextR.first, nextR.second, R.first, R.second);
				if(!G[nextL.first][nextL.second][nextR.first][nextR.second]){
					G[nextL.first][nextL.second][nextR.first][nextR.second] = true;
					que.push({nextL, nextR});
				}
			}
		}

		cout << (res ? "Yes" : "No") << endl;
	}

}

Measured memory_bytes: 9276