#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;
#define int long long int
const int INF = 1001001001001001LL;
const int MOD = 1000000007;

int used[60][60][60][60] = {};

int di[4] = {-1, 0, 1, 0};
int dj[4] = {0, 1, 0, -1};

signed main(){
    
    while(1){
       
        int h, w; cin >> w >> h;
        if(h == 0) break;
        

        memset(used, 0, sizeof(used));    
        vector<vector<int> > L(h + 2, vector<int> (w + 2, 0));
        vector<vector<int> > R(h + 2, vector<int> (w + 2, 0));
        
        int sli, slj, gli, glj, sri, srj, gri, grj;

        for(int i = 1; i <= h; i++){
            for(int j = 1; j <= w; j++){
                char c; cin >> c;
                if(c == '#') continue;
                L[i][j] = 1;
                if(c == 'L'){
                    sli = i;
                    slj = j;
                }

                if(c == '%'){
                    gli = i;
                    glj = j;
                }
            }

            for(int j = 1; j <= w; j++){
                char c; cin >> c;
                if(c == '#') continue;
                R[i][j] = 1;
                if(c == 'R'){
                    sri = i;
                    srj = j;
                }
                
                if(c == '%'){
                    gri = i;
                    grj = j;
                }
            }
        }
        
        queue<pair<int, pair<pair<int, int>, pair<int, int> > > > q;
        q.push({0, {{sli, slj}, {sri, srj}}});
        used[sli][slj][sri][srj] = 1;

        bool flag = false;

        while(!q.empty()){
            int li = q.front().second.first.first;
            int lj = q.front().second.first.second;
            int ri = q.front().second.second.first;
            int rj = q.front().second.second.second;
            int cost = q.front().first;

            q.pop();
            bool f1 = (li == gli && lj == glj);
            bool f2 = (ri == gri && rj == grj);

            

            if(f1 && f2){
                flag = true;
                break;
            }else if(f1 || f2) continue;

            
            for(int h = 0; h < 4; h++){
                int nli = li + di[h];
                int nlj = lj + dj[h];
                int nri = ri + di[h];
                int nrj = rj - dj[h];
                if(!L[nli][nlj]){
                    nli = li;
                    nlj = lj;
                }
                if(!R[nri][nrj]){
                    nri = ri;
                    nrj = rj;
                }

                if(!used[nli][nlj][nri][nrj]){
                    used[nli][nlj][nri][nrj] = 1;
                    q.push({cost + 1, {{nli, nlj}, {nri, nrj}}});
                }
            }
        }

        if(flag) cout << "Yes" << endl;
        else cout << "No" << endl;
    }


    return 0;
}




Measured memory_bytes: 106324