#include <bits/stdc++.h>

using namespace std;
using pi=pair<int,int>;

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

pair<pi,pi> susumu(pi tl,pi tr,int dir,vector<vector<char>> &l,vector<vector<char>> &r) {
    pair<pi,pi> ret;
    int ny,nx;
    ny=tl.first+dy[dir];
    nx=tl.second+dx[dir];
    if(l[ny][nx]!='#')ret.first=pi(ny,nx);
    else ret.first=tl;

    if(dir==1||dir==3)dir=(dir+2)%4;
    ny=tr.first+dy[dir];
    nx=tr.second+dx[dir];
    if(r[ny][nx]!='#')ret.second=pi(ny,nx);
    else ret.second=tr;
    return ret;
}

bool solve(){
    int w,h;
    cin>>w>>h;
    if(w==0)return false;
    pi tl,tr,gl,gr;
    vector<vector<char>> l(h+2,vector<char>(w+2,'#')),r(h+2,vector<char>(w+2,'#'));
    for (int i = 1; i <= h; ++i) {
        char c;
        for (int j = 1; j <= w; ++j) {
            cin>>c;
            l[i][j]=c;
            if(c=='L')tl=pi(i,j);
            if(c=='%')gl=pi(i,j);
        }
        for (int j = 1; j <= w; ++j) {
            cin>>c;
            r[i][j]=c;
            if(c=='R')tr=pi(i,j);
            if(c=='%')gr=pi(i,j);
        }
    }
    set<pair<pi,pi>> st;
    queue<pair<pi,pi>> q;
    q.push(make_pair(tl,tr));
    while(!q.empty()){
        //cout<<q.size()<<endl;
        auto p=q.front();
        //cout<<p.first.first<<" "<<p.first.second<<" "<<p.second.first<<" "<<p.second.second<<endl;
        q.pop();
        if(p.first==gl&&p.second==gr){
            cout<<"Yes"<<endl;
            return true;
        }
        if(p.first==gl||p.second==gr)continue;
        for (int i = 0; i < 4; ++i) {
            auto np=susumu(p.first,p.second,i,l,r);
            if(st.find(np)==st.end()){
                q.push(np);
                st.insert(np);
            }
        }
    }
    cout<<"No"<<endl;
    return true;
}

int main(){
    while(solve());
    return 0;
}

/*
50 50 間に合うんかこれ？
L................................................. %.................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................. ..................................................
.................................................% .................................................R
 */



Measured memory_bytes: 108916