loop do
	w, h = gets.split.map &:to_i
	break if w == 0
	input = (1..h).map {gets.chomp}

	al = (0..h+1).map { [] }
	ar = (0..h+1).map { [] }

	ly = lx = ry = rx = nil

	(0..h+1).each do |y|
		(0..w+1).each do |x|
			if [0, h+1].include?(y) || [0, w+1].include?(x)
				al[y][x] = ar[y][x] = ?#
			else
				al[y][x] = input[y-1][x-1]
				ar[y][x] = input[y-1][x-w-1]
				ly, lx = y, x if al[y][x] == ?L
				ry, rx = y, x if ar[y][x] == ?R
			end
		end
	end

	start = [ly, lx, ry, rx]
	stack = [start]
	reached = {start => 0}

	ok = false
	until stack.empty?
		ly0, lx0, ry0, rx0 = stack.pop
		[[-1,0],[1,0],[0,-1],[0,1]].each do |dy, dx|
			ly1, lx1, ry1, rx1 = ly0+dy, lx0+dx, ry0+dy, rx0-dx
			ly1, lx1 = ly0, lx0 if al[ly1][lx1] == ?#
			ry1, rx1 = ry0, rx0 if ar[ry1][rx1] == ?#

			if al[ly1][lx1] == ?% && ar[ry1][rx1] == ?%
				ok = true
				break
			end

			next if al[ly1][lx1] == ?% || ar[ry1][rx1] == ?%

			v = [ly1, lx1, ry1, rx1]
			next if reached[v]
			reached[v] = 1
			
			stack << v
		end
		break if ok
	end
	puts ok ? 'Yes' : 'No'
end