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
        print(w,h)
        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
        lp = None
        rp = None
        for i in range(1,h+2):
            for j in range(1,w+2):
                if la[i][j] == 'L':
                    ls = (i,j)
                elif la[i][j] == '%':
                    lp = (i,j)
                if ra[i][j] == 'R':
                    rs = (i,j)
                elif ra[i][j] == '%':
                    rp = (i,j)
        lla = []
        rra = []
        for i in range(h+2):
            tl = []
            tr = []
            for j in range(w+2):
                if la[i][j] == '#':
                    tl.append(None)
                else:
                    tl.append(1)
                if ra[i][j] == '#':
                    tr.append(None)
                else:
                    tr.append(1)
            lla.append(tl)
            rra.append(tr)


        def search(s):
            q = []
            q.append(s)
            v = set()
            v.add(s)
            qi = 0
            while len(q) > qi:
                u = q[qi]
                qi += 1

                for di, dj in dd:
                    li = u[0][0]
                    lj = u[0][1]
                    if not lla[li+di][lj+dj] is None:
                        li += di
                        lj += dj
                    ri = u[1][0]
                    rj = u[1][1]
                    if not rra[ri+di][rj-dj] is None:
                        ri += di
                        rj -= dj

                    uv = ((li,lj), (ri,rj))
                    if uv in v:
                        continue
                    v.add(uv)
                    if (li,lj) == lp and (ri,rj) == rp:
                        # print(len(q))
                        return True
                    if (li,lj) == lp:
                        continue
                    if (ri,rj) == rp:
                        continue

                    q.append(uv)

            # print(len(q))
            return False

        if search((ls,rs)):
            rr.append('Yes')
        else:
            rr.append('No')
        # print(rr[-1])


    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())