import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(0,-1),(1,0),(0,1),(-1,0)]
ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    while True:
        w,h = LI()
        if w == 0:
            break
        la = ["#" * (w+2)]
        ra = ["#" * (w+2)]
        for _ in range(h):
            l,r = LS()
            la.append("#{}#".format(l))
            ra.append("#{}#".format(r))
        la.append("#" * (w+2))
        ra.append("#" * (w+2))
        ls = None
        rs = None
        for i in range(1,h+2):
            for j in range(1,w+2):
                if la[i][j] == 'L':
                    ls = (i,j)
                if ra[i][j] == 'R':
                    rs = (i,j)

        def search(s):
            d = collections.defaultdict(lambda: inf)
            d[s] = 0
            q = []
            heapq.heappush(q, (0, s))
            v = collections.defaultdict(bool)
            while len(q):
                k, u = heapq.heappop(q)
                if v[u]:
                    continue
                v[u] = True

                for di, dj in dd:
                    li = u[0][0] + di
                    lj = u[0][1] + dj
                    if la[li][lj] == "#":
                        li -= di
                        lj -= dj
                    ri = u[1][0] + di
                    rj = u[1][1] - dj
                    if ra[ri][rj] == "#":
                        ri -= di
                        rj += dj
                    if la[li][lj] == '%' and ra[ri][rj] == '%':
                        return True
                    if la[li][lj] == '%':
                        continue
                    if ra[ri][rj] == '%':
                        continue
                    uv = ((li,lj), (ri,rj))

                    if v[uv]:
                        continue
                    vd = k + 1
                    if d[uv] > vd:
                        d[uv] = vd
                        heapq.heappush(q, (vd, uv))

            return False

        if search((ls,rs)):
            rr.append('Yes')
        else:
            rr.append('No')


    return '\n'.join(map(str,rr))


print(main())




### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    def f(w, h):
        w2 = w+2
        la = ['#' * w2]
        ra = ['#' * w2]
        ls = rs = None
        for i in range(1,h+1):
            lt, rt = LS()
            if 'L' in lt:
                ls = (i, lt.index('L') + 1)
            if 'R' in rt:
                rs = (i, rt.index('R') + 1)
            la.append('#' + lt + '#')
            ra.append('#' + rt + '#')
        la.append('#' * w2)
        ra.append('#' * w2)

        q = collections.deque([(ls[0], ls[1], rs[0], rs[1])])
        v = collections.defaultdict(bool)
        v[(ls[0], ls[1], rs[0], rs[1])] = 1
        while q:
            ly,lx,ry,rx = q.pop()
            for dy, dx in dd:
                lty = ly + dy
                ltx = lx + dx
                rty = ry + dy
                rtx = rx - dx
                if la[lty][ltx] == '#':
                    lty = ly
                    ltx = lx
                if ra[rty][rtx] == '#':
                    rty = ry
                    rtx = rx
                if v[(lty,ltx,rty,rtx)]:
                    continue
                v[(lty,ltx,rty,rtx)] = 1
                if la[lty][ltx] == '%' and ra[rty][rtx] == '%':
                    return 'Yes'
                if la[lty][ltx] != '%' and ra[rty][rtx] != '%':
                    q.append((lty,ltx,rty,rtx))

        return 'No'

    while True:
        w,h = LI()
        if w == 0 and h == 0:
            break
        rr.append(f(w,h))

    return '\n'.join(rr)



print(main())