#include <bits/stdc++.h>
using namespace std;

int w, h; 
struct Pos {
  int x;
  int y;
  bool operator==(Pos that) {
    return x == that.x && y == that.y;
  }
  Pos operator+(Pos that) {
    return {x+that.x, y+that.y};
  }

  Pos (int xx, int yy) {
    x = xx; y = yy;
  }
};

bool inner(Pos p) {
  return 0 <= p.x && p.x < w
      && 0 <= p.y && p.y < h;
}

Pos search_charactor(vector<string> &map, char charactor) {
  for (int i=0; i<map.size(); i++)
    for (int l=0; l<map[i].size(); l++)
      if (map[i][l] == charactor) {
        map[i][l] = '.';
        return {l, i};
      }
}

bool exnor (bool x, bool y) {
  return !(x xor y);
}

template <typename T>
using V=vector<T>;

int main(){
  while (cin >> w >> h, w+h != 0) {
    vector<string> rooml, roomr;
    rooml.reserve(h); roomr.reserve(h);
    for (int i=0; i<h; i++) {
      string l, r;
      cin >> l >> r; 
      reverse(r.begin(), r.end());
      rooml.push_back(l);
      roomr.push_back(r);
    }
    Pos len_pos = search_charactor(rooml, 'L');
    Pos rin_pos = search_charactor(roomr, 'R');
    Pos len_goal = search_charactor(rooml, '%');
    Pos rin_goal = search_charactor(roomr, '%');

    queue<pair<Pos, Pos>> q;
    q.push(make_pair(len_pos, rin_pos));
    // cout<<"goal: ("<<len_goal.x<<", "<<len_goal.y<<") "<<"("<<rin_goal.x<<", "<<rin_goal.y<<")"<<endl;
    // for (int i=0; i<rooml.size(); i++) {
    //   cout << rooml[i] << " " << roomr[i] << endl;
    // }

    V<V<V<V<bool>>>> already(h, V<V<V<bool>>>(w, V<V<bool>>(h, V<bool>(w, false))));
    bool f = true;
    while (!q.empty()) {
      Pos len = q.front().first;
      Pos rin = q.front().second; 
      q.pop();
      // cout<<"("<<len.x<<", "<<len.y<<") "<<"("<<rin.x<<", "<<rin.y<<")"<<endl;

      if (len==len_goal && rin==rin_goal) {
        cout << "Yes" << endl;
        f = false;
        break;
      }

      for (Pos np: {Pos(0,1), Pos(0,-1), Pos(1,0), Pos(-1,0)}) {
        Pos l = (inner(np+len) && rooml[np.y+len.y][np.x+len.x] == '.') ? len + np : len;
        Pos r = (inner(np+rin) && roomr[np.y+rin.y][np.x+rin.x] == '.') ? rin + np : rin;
        if (!already[l.y][l.x][r.y][r.x] && inner(l) && inner(r) 
          && rooml[l.y][l.x] == '.' && roomr[r.y][r.x] == '.'
          && exnor(l==len_goal, r==rin_goal)) {
          q.push(make_pair(l, r));
          already[l.y][l.x][r.y][r.x] = true;
        }
      }
    }
    if (f) cout << "No" << endl;
  }
}

