require 'set'

one_pos = (0..(1 << 12) - 1).map do |x|
    (0..11).select {|i| x[i] == 1}
end
    
loop do
    hp_init, hp_max = gets.split.map(&:to_i)
    break if hp_init == 0
    r, c = gets.split.map(&:to_i)
    dungeon = (1..r).map { gets.chomp.split("") }
    
    damage = {}
    gets.to_i.times do 
        c, d = gets.chomp.split
        damage[c] = d.to_i
    end
    
    dyx = {
        ?U => [-1, 0],
        ?D => [1, 0],
        ?L => [0, -1],
        ?R => [0, 1],
    }
    
    x = y = 0
    damage_seq = []
    
    gets.to_i.times do
        dir, k = gets.split
        dy, dx = dyx[dir]
        k.to_i.times do
            x += dx
            y += dy
            damage_seq << damage[dungeon[y][x]]
        end
    end
    
    potions = (1..gets.to_i).map { gets.to_i }
    table = (0..(1 << potions.size) - 1).map do |x|
        s = (0..potions.size-1).select {|i| x[i] == 1}.map {|i| potions[i]}.inject(:+) || 0
        [hp_init + s, hp_max].min
    end

    xs = Set[*(0..(1 << potions.size) - 1).to_a]
    damage_seq.each do |d|
        to_be_deleted = []
        xs.each do |x|
            table[x] = (table[x] > d ? table[x] - d : -Float::INFINITY)
            one_pos[x].each do |i| 
                y = x - (1 << i)
                h = table[y] + potions[i]
                h = hp_max if h > hp_max
                table[x] = h if h > table[x]
            end
            if table[x] <= 0
                to_be_deleted << x
            end
        end

        to_be_deleted.each do |x|
            xs.delete(x)
        end
    end
    
    ans = xs.empty? ? 'NO' : 'YES'
    puts ans
end