loop do
  w, h = gets.split.map(&:to_i)
  break if w == 0
  fld_l = '#' * (w + 2)
  fld_r = '#' * (w + 2)
  pl = pr = 0
  h.times do |i|
    l, r = gets.split(' ')
    pl = (w + 2) * (i + 1) + l.index('L') + 1 if l.include?('L')
    pr = (w + 2) * (i + 1) + r.index('R') + 1 if r.include?('R')
    fld_l += '#' + l + '#'; fld_r += '#' + r + '#'
  end
  fld_l += '#' * (w + 2); fld_r += '#' * (w + 2)
  arr = []
  arr << [pl, pr]
  visit = []
  visit << [pl, pr]
  res = 0
  until arr.empty?
    l, r = arr.shift
    [[-1, 0], [1, 0], [0, -1], [0, 1]].each do |y, x|
      nxt_l = l + y * (w + 2) + x
      nxt_r = r + y * (w + 2) - x
      if !visit.include?([nxt_l, nxt_r])
        if fld_l[nxt_l] == '%' && fld_r[nxt_r] == '%'
          res = 1
          break
        end
        if (fld_l[nxt_l] == '#' && fld_r[nxt_r] == '#') || (fld_l[nxt_l] == '%' || fld_r[nxt_r] == '%')
          next
        end
        nxt_l = l if fld_l[nxt_l] == '#'
        nxt_r = r if fld_r[nxt_r] == '#'
        arr << [nxt_l, nxt_r]
        visit << [nxt_l, nxt_r]
      end
    end
  end
  puts res == 0 ?  'No' : 'Yes'
end