use std::io::*;
use std::str::FromStr;
use utils::*;

pub fn main() {
    let i = stdin();
    let mut o = Vec::new();
    run(i.lock(), &mut o);
    stdout().write_all(&o).unwrap();
}

fn run<R: BufRead, W: Write>(i: R, o: &mut W) {
    let mut i = CpReader::new(i);
    let (h, w, _n) = i.read3::<usize, usize, usize>();
    let (y, x) = i.read2::<usize, usize>();
    let s: Vec<_> = i.read_line_bytes_vec();
    let t: Vec<_> = i.read_line_bytes_vec();

    let ans = if solve(y - 1, x - 1, h, w, &s, &t) {
        "YES"
    } else {
        "NO"
    };
    writeln!(o, "{}", ans).unwrap();
}
fn solve(y: usize, x: usize, h: usize, w: usize, s: &[u8], t: &[u8]) -> bool {
    let mut rx0 = 0;
    let mut rx1 = 0;
    let mut ry0 = 0;
    let mut ry1 = 0;
    for (&s, &t) in s.iter().zip(t).rev() {
        if rx0 + rx1 == w {
            return false;
        }
        if ry0 + ry1 == h {
            return false;
        }
        match t {
            b'L' => {
                if rx1 > 0 {
                    rx1 -= 1;
                }
            }
            b'R' => {
                if rx0 > 0 {
                    rx0 -= 1;
                }
            }
            b'U' => {
                if ry1 > 0 {
                    ry1 -= 1;
                }
            }
            b'D' => {
                if ry0 > 0 {
                    ry0 -= 1;
                }
            }
            _ => unreachable!(),
        }
        match s {
            b'L' => rx0 += 1,
            b'R' => rx1 += 1,
            b'U' => ry0 += 1,
            b'D' => ry1 += 1,
            _ => unreachable!(),
        }
    }
    !(rx0 >= x + 1 || ry0 >= y + 1 || rx1 >= w - x || ry1 >= h - y)
}

mod utils {
    use super::*;

    pub struct CpReader<R: BufRead> {
        r: R,
        s: String,
        b: Vec<u8>,
    }

    macro_rules! fn_read {
        { $f:ident($($t:ident),*) } => {
            #[allow(dead_code)]
            pub fn $f<$($t: FromStr),*>(&mut self) -> ($($t),*) {
                let i = &mut self.read_line().split(' ');
                ($(read_next::<$t,_>(i)),*)
            }
        };
    }

    impl<R: BufRead> CpReader<R> {
        pub fn new(r: R) -> Self {
            CpReader {
                r: r,
                s: String::new(),
                b: Vec::new(),
            }
        }

        pub fn read_line(&mut self) -> &str {
            self.s.clear();
            self.b.clear();
            self.r.read_line(&mut self.s).unwrap();
            self.s.trim()
        }

        #[allow(dead_code)]
        pub fn read_line_bytes(&mut self) -> &[u8] {
            self.s.clear();
            self.b.clear();
            self.r.read_until(b'\n', &mut self.b).unwrap();
            if self.b.last() == Some(&b'\n') {
                self.b.pop();
            }
            &self.b
        }
        pub fn read_line_bytes_vec(&mut self) -> Vec<u8> {
            let mut b = Vec::new();
            self.r.read_until(b'\n', &mut b).unwrap();
            if b.last() == Some(&b'\n') {
                b.pop();
            }
            b
        }

        fn_read! { read2(T1, T2) }
        fn_read! { read3(T1, T2, T3) }
        fn_read! { read4(T1, T2, T3, T4) }
        fn_read! { read5(T1, T2, T3, T4, T5) }

    }
    fn read_next<'a, T: FromStr, I: Iterator<Item = &'a str>>(i: &mut I) -> T {
        i.next().unwrap().parse().ok().unwrap()
    }

}


Measured memory_bytes: 4352