#include <iostream>
#include <algorithm>
#include <queue>
#define F first
#define S second
using namespace std;

const int N = 50 + 1;
char l[N][N];
char r[N][N];

int r_di[] = { 0,  0, -1, +1};
int r_dj[] = {-1, +1,  0,  0};
int l_di[] = { 0,  0, -1, +1};
int l_dj[] = {+1, -1,  0,  0};

bool vis[N][N][N][N];

typedef pair< pair<int, int>, pair<int, int> > P;

inline
bool& ref(P p)
{
  pair<int, int> a = p.first;
  pair<int, int> b = p.second;
  return vis[a.first][a.second][b.first][b.second];
}

int main(void)
{
  int h, w;
  while (cin >> w >> h && (h | w)) {
    fill(&vis[0][0][0][0], &vis[N - 1][N - 1][N - 1][N - 1] + 1, false);
    pair<int, int> pr, pl;
    pair<int, int> qr, ql;
    pr = pl = qr = ql = make_pair(-1, -1);
    for (int i = 0; i < h; ++i) {
      string s, t;
      cin >> s >> t;
      for (int j = 0; j < s.size(); ++j) {
	l[i][j] = s[j];
	if (s[j] == 'L') pl = make_pair(i, j);
	if (s[j] == '%') ql = make_pair(i, j);
      }
      for (int j = 0; j < t.size(); ++j) {
	r[i][j] = t[j];
	if (t[j] == 'R') pr = make_pair(i, j);
	if (t[j] == '%') qr = make_pair(i, j);
      }
    }
    queue<P> q;
    P ini = make_pair(pl, pr);
    ref(ini) = true;
    for (q.push(ini); q.size(); q.pop()) {
      P p = q.front();
      pair<int, int> pl = p.first;
      pair<int, int> pr = p.second;
      if(l[pl.F][pl.S] == '%' && r[pr.F][pr.S] != '%')continue;
      if(r[pr.F][pr.S] == '%' && l[pl.F][pl.S] != '%')continue;

      for (int d = 0; d < 4; ++d) {
	int pr_i = pr.first  + r_di[d];
	int pr_j = pr.second + r_dj[d];
	int pl_i = pl.first  + l_di[d];
	int pl_j = pl.second + l_dj[d];
	if (pr_i < 0 || h <= pr_i) pr_i = pr.first, pr_j = pr.second;
	if (pr_j < 0 || w <= pr_j) pr_i = pr.first, pr_j = pr.second;
	if (r[pr_i][pr_j] == '#')  pr_i = pr.first, pr_j = pr.second;
	if (pl_i < 0 || h <= pl_i) pl_i = pl.first, pl_j = pl.second;
	if (pl_j < 0 || w <= pl_j) pl_i = pl.first, pl_j = pl.second;
	if (l[pl_i][pl_j] == '#')  pl_i = pl.first, pl_j = pl.second;
	P next = make_pair(make_pair(pl_i, pl_j), make_pair(pr_i, pr_j));
	if (ref(next)) continue;
	ref(next) = true;
	q.push(next);
      }
    }
    cout << (ref(make_pair(ql, qr)) ? "Yes" : "No") << endl;
  }
  return 0;
}