#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
// #define USE_LLONG_AS_INT
#ifdef USE_LLONG_AS_INT
#define int long long
#define inf (1ll<<60)
#else
#define inf (1<<30)
#endif
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

int w,h;
char rl[50][50],rr[50][50];
int syl,sxl,syr,sxr;
bool used[50][50][50][50];

bool bfs(){
    int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
    queue<pi> ql,qr;
    memset(used,false,sizeof(used));
    ql.push({syl,sxl}),qr.push({syr,sxr});
    used[syl][sxl][syr][sxr]=true;
    while(!ql.empty()){
        pi l=ql.front(),r=qr.front();
        ql.pop(),qr.pop();
        int yl=l.fi,xl=l.se,yr=r.fi,xr=r.se;
        if(rl[yl][xl]=='%'&&rr[yr][xr]=='%'){
            return true;
        }
        if(rl[yl][xl]!='%'&&rr[yr][xr]!='%'){
            rep(i,4){
                int nyl=min(h-1,max(0,yl+dy[i]));
                int nxl=min(w-1,max(0,xl+dx[i]));
                int nyr=min(h-1,max(0,yr+dy[i]));
                int nxr=min(w-1,max(0,xr-dx[i]));
                if(rl[nyl][nxl]=='#')nyl=yl,nxl=xl;
                if(rr[nyr][nxr]=='#')nyr=yr,nxr=xr;
                if(!used[nyl][nxl][nyr][nxr]){
                    used[nyl][nxl][nyr][nxr]=true;
                    ql.push({nyl,nxl}),qr.push({nyr,nxr});
                }
            }
        }
    }
    return false;
}

void run(){
    cin>>w>>h;
    if(!w)return;
    rep(i,h){
        rep(j,w)cin>>rl[i][j];
        rep(j,w)cin>>rr[i][j];
    }
    rep(i,h){
        rep(j,w){
            if(rl[i][j]=='L')sxl=j,syl=i;
            if(rr[i][j]=='R')sxr=j,syr=i;
        }
    }
    Yes(bfs());
    run();
}
