#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

int dx1[4] = {1, 0, -1, 0}, dy1[4] = {0, 1, 0, -1};
int dx2[4] = {1, 0, -1, 0}, dy2[4] = {0, -1, 0, 1};
bool visit[60][60][60][60];
string room1[60], room2[60];

struct Position
{
    int sx1, sy1, sx2, sy2;
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int w, h;
    while (cin >> w >> h, w || h)
    {
        string str = "";
        for (int i = 0; i <= w + 1; i++)
            str += '#';
        room1[0] = room2[0] = room1[h + 1] = room2[h + 1] = str;
        for (int i = 1; i <= h; i++)
        {
            string s1, s2;
            cin >> s1 >> s2;
            room1[i] = '#' + s1 + '#';
            room2[i] = '#' + s2 + '#';
        }
        int sx1 = -1, sy1 = -1, sx2 = -1, sy2 = -1;
        for (int i = 1; i <= h; i++)
        {
            for (int j = 1; j <= w; j++)
            {
                if (room1[i][j] == 'L')
                {
                    sx1 = i;
                    sy1 = j;
                    room1[i][j] = '.';
                }
                if (room2[i][j] == 'R')
                {
                    sx2 = i;
                    sy2 = j;
                    room2[i][j] = '.';
                }
            }
        }
        memset(visit, 0, sizeof(visit));
        queue<Position> que;
        visit[sx1][sy1][sx2][sy2] = true;
        que.push(Position{sx1, sy1, sx2, sy2});
        bool f = false;
        while (!que.empty())
        {
            if (f)
                break;
            Position pos = que.front();
            que.pop();
            for (int i = 0; i < 4; i++)
            {
                int nx1 = pos.sx1 + dx1[i], ny1 = pos.sy1 + dy1[i], nx2 = pos.sx2 + dx2[i], ny2 = pos.sy2 + dy2[i];
                char c1 = room1[nx1][ny1], c2 = room2[nx2][ny2];
                if (c1 == '#' && c2 == '#')
                    continue;
                if (c1 == '%' && c2 == '%')
                {
                    f = true;
                    break;
                }
                if (c1 == '%' || c2 == '%')
                    continue;
                if (visit[nx1][ny1][nx2][ny2])
                    continue;
                if (c1 == '#')
                {
                    if (visit[pos.sx1][pos.sy1][nx2][ny2])
                        continue;
                    visit[pos.sx1][pos.sy1][nx2][ny2] = true;
                    que.push(Position{pos.sx1, pos.sy1, nx2, ny2});
                }
                else if (c2 == '#')
                {
                    if (visit[nx1][ny1][pos.sx2][pos.sy2])
                        continue;
                    visit[nx1][ny1][pos.sx2][pos.sy2] = true;
                    que.push(Position{nx1, ny1, pos.sx2, pos.sy2});
                }
                else
                {
                    if (visit[nx1][ny1][nx2][ny2])
                        continue;
                    visit[nx1][ny1][nx2][ny2] = true;
                    que.push(Position{nx1, ny1, nx2, ny2});
                }
            }
        }
        if (f)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }
}



Measured memory_bytes: 16608