# define _CRT_SECURE_NO_WARNINGS 1
# define _USE_MATH_DEFINES
# include <iostream>
# include <numeric>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <deque>
# include <iomanip>
# include <queue>
# include <sstream>
# include <unordered_set>
# include <unordered_map>
# include <climits>
# include <complex>
# include <cmath>
# include <list>
# include <functional>
# include <string>
# include <ctime>
# include <set>
# include <forward_list>
# include <map>
# include <stack>
using namespace std;
# define MP make_pair
# define INF ((int)(1<<25))
# define REP(i,n) for(int i=0;i<(int)n;i++)
# define FOR(i,n) REP(i,n)
# define FORI(i,k,n) for(int i=k;i<(int)n;i++)
# define TORAD 2.0*M_PI/360.0
# define INT(x) int x;cin>>x;
# define STRING(x) string x;cin>>x;
# define STR(x) STRING(x);
# define DOUBLE(x) double x;cin>>x;
# define DBL(x) DOUBLE(x); 
# define ALL(x) begin(x),end(x)
# define RALL(x) (x).rbegin(),(x).rend()
# define DEBUG(x) cout<<#x<<":"<<x<<endl
# define INIT(a) memset(a,-1,sizeof a)
# define CLR(a) memset(a,0,sizeof a)
# define EPS 1e-12
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
typedef long long lint;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<int> vi;
typedef vector<lint> vl;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
const int dx[4] = { 0,1,0,-1 }, dy[4] = { -1,0,1,0 };
//const int M = 1000000007;
template<class T> void debug(T a) { for ( auto i : a )cout << i << endl; }

# define DEP(a) a.first,a.second

int main()
{
	while ( true )
	{
		int w, h;
		cin >> w >> h;
		if ( !w )break;
		int a[2][60][60];
		pii start[2];
		INIT(a);
		FORI(i,1, h+1)
		{
			FOR(j, 2)
			{
				string s; cin >> s;
				FOR(k, s.size())
				{
					a[j][i][k + 1] = 0;
					if ( s[k] == '%' )
					{
						a[j][i][k + 1] = 1;
					}
					if ( s[k] == 'L' || s[k] == 'R' )
					{
						start[j] = MP(i, k + 1);
					}
					if ( s[k] == '#' )
					{
						a[j][i][k + 1] = -1;
					}
				}
			}
		}
		struct P
		{
			int x[2], y[2];
			P(int lx, int ly, int rx, int ry)  { x[0] = lx; x[1] = rx; y[0] = ly; y[1] = ry; }
		};

		bool flag[60][60][60][60] = {};

		queue<P> que;
		que.emplace(DEP(start[0]), DEP(start[1]));
		bool yes = false;

		while ( !que.empty() )
		{
			P now = que.front(); que.pop();
			int l, r;
			l = a[0][now.x[0]][now.y[0]];
			r = a[1][now.x[1]][now.y[1]];
			if ( (l&&!r) || (!l&&r) )continue;
			if ( l&&r )
			{
				yes = true;
				break;
			}
			FOR(i, 4)
			{
				P next = now;
				next.x[0] += dx[i];
				next.y[0] += dy[i];

				next.x[1] += dx[i];
				next.y[1] -= dy[i];

				auto check = [&a] (int x, int y, int d)->bool { return a[d][x][y] == -1; };

				if ( check(next.x[0], next.y[0], 0) )
				{
					next.x[0] -= dx[i];
					next.y[0] -= dy[i];
				}

				if ( check(next.x[1], next.y[1], 1) )
				{
					next.x[1] -= dx[i];
					next.y[1] += dy[i];
				}

				bool *f = &flag[next.x[0]][next.y[0]][next.x[1]][next.y[1]];
				if ( !*f )
				{
					*f = true;
					que.push(next);
				}
			}

		}
		cout << (yes?"Yes" : "No") << endl;

	}
}

Measured memory_bytes: 16632