from collections import deque, defaultdict

def main():
  directs = ((-1, 0, 1, 0), (1, 0, -1, 0), (0, 1, 0, 1), (0, -1, 0, -1))
  while True:
    w, h = map(int, input().split())
    if w == 0:
      break
  
    mp_l = ["#" * (w + 2)]
    mp_r = ["#" * (w + 2)]
    for _ in range(h):
      l, r = input().split()
      l = "#" + l + "#"
      r = "#" + r + "#"
      mp_l.append(l)
      mp_r.append(r)
    mp_l.append("#" * (w + 2))
    mp_r.append("#" * (w + 2))
    
    for y in range(1, h + 1):
      for x in range(1, w + 1):
        if mp_l[y][x] == "L":
          start_l = (x, y)
        if mp_r[y][x] == "R":
          start_r = (x, y)
    
    dic = [[[[False] * (h + 2) for _ in range(w + 2)] for _ in range(h + 2)] for _ in range(w + 2)]
    def search():
      que = deque()
      app = que.append
      pop = que.popleft
      app((start_l[0], start_l[1], start_r[0], start_r[1]))
      dic[start_l[0]][start_l[1]][start_r[0]][start_r[1]] = True
      while que:
        lx, ly, rx, ry = pop()
        for ldx, ldy, rdx, rdy in directs:
          lnx, lny = (lx + ldx, ly + ldy) if mp_l[ly + ldy][lx + ldx] != "#" else (lx, ly)
          rnx, rny = (rx + rdx, ry + rdy) if mp_r[ry + rdy][rx + rdx] != "#" else (rx, ry)
          if not dic[lnx][lny][rnx][rny]:
            dic[lnx][lny][rnx][rny] = True
            lsym, rsym = mp_l[lny][lnx], mp_r[rny][rnx]
            if lsym == "%" and rsym == "%":
              print("Yes")
              return
            if lsym != "%" and rsym != "%":
              app(((lnx, lny, rnx, rny)))
      else:
        print("No")
        return
    search()
 
main()


### FIXED CODE ###

from collections import deque, defaultdict

def main():
  directs = ((-1, 0, 1, 0), (1, 0, -1, 0), (0, 1, 0, 1), (0, -1, 0, -1))
  while True:
    w, h = map(int, input().split())
    if w == 0:
      break
  
    mp_l = ["#" * (w + 2)]
    mp_r = ["#" * (w + 2)]
    for _ in range(h):
      l, r = input().split()
      l = "#" + l + "#"
      r = "#" + r + "#"
      mp_l.append(l)
      mp_r.append(r)
    mp_l.append("#" * (w + 2))
    mp_r.append("#" * (w + 2))
    
    for y in range(1, h + 1):
      for x in range(1, w + 1):
        if mp_l[y][x] == "L":
          start_l = (x, y)
        if mp_r[y][x] == "R":
          start_r = (x, y)
    
    dic = [[[[None] * (h + 2) for _ in range(w + 2)] for _ in range(h + 2)] for _ in range(w + 2)]
    def search():
      que = deque()
      app = que.append
      pop = que.popleft
      app((start_l[0], start_l[1], start_r[0], start_r[1]))
      dic[start_l[0]][start_l[1]][start_r[0]][start_r[1]] = True
      while que:
        lx, ly, rx, ry = pop()
        for ldx, ldy, rdx, rdy in directs:
          ltx, lty, rtx, rty = lx + ldx, ly + ldy, rx + rdx, ry + rdy
          if mp_l[lty][ltx] != "#":
            lnx, lny = ltx, lty
          else:
            lnx, lny = lx, ly
          if mp_r[rty][rtx] != "#":
            rnx, rny = rtx, rty
          else:
            rnx, rny = rx, ry
          tmp = dic[lnx][lny][rnx]
          if not tmp[rny]:
            tmp[rny] = True
            lsym, rsym = mp_l[lny][lnx], mp_r[rny][rnx]
            if lsym == "%":
              if rsym == "%":
                print("Yes")
                return
            elif rsym != "%":
              app(((lnx, lny, rnx, rny)))
      print("No")
      return
    search()
 
main()