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

int main() {
    int hp_init, hp_max;
    while(cin >> hp_init >> hp_max, hp_init) {
        int R, C;
        cin >> R >> C;
        vector<string> dungeon(R);
        for(int i=0; i<R; ++i) {
            cin >> dungeon[i];
        }

        int T;
        cin >> T;
        vector<int> damage(26, 0);
        for(int i=0; i<T; ++i) {
            char c;
            int d;
            cin >> c >> d;
            damage[c - 'A'] = d;
        }

        int S;
        cin >> S;
        vector<char> dir(S);
        vector<int> dist(S);
        for(int i=0; i<S; ++i) {
            cin >> dir[i] >> dist[i];
        }

        int P;
        cin >> P;
        vector<int> portion(P);
        for(int i=0; i<P; ++i) {
            cin >> portion[i];
        }

        vector<int> dp(1 << P);
        dp[(1 << P) - 1] = hp_init;
        int y = 0, x = 0;
        for(int i=0; i<S; ++i) {
            int dy = 0, dx = 0;
            if(dir[i] == 'D') {
                dy = 1;
            } else if(dir[i] == 'U') {
                dy = -1;
            } else if(dir[i] == 'L') {
                dx = -1;
            } else {
                dx = 1;
            }

            for(int j=0; j<dist[i]; ++j) {
                int ny = y + dy;
                int nx = x + dx;
                for(int p = (1 << P) - 1; p >= 0; --p) {
                    if(dp[p] <= 0) {
                        continue;
                    }
                    for(int k = 0; k < P; ++k) {
                        if(!((p >> k) & 1)) {
                            continue;
                        }
                        int next_p = p & ~(1 << k);
                        int next_hp = min(dp[p] + portion[k], hp_max);
                        dp[next_p] = max(dp[next_p], next_hp);
                    }
                }
                for(int p=0; p < (1 << P); ++p) {
                    dp[p] -= damage[dungeon[ny][nx] - 'A'];
                }
                y = ny;
                x = nx;
            }
        }
        if(*max_element(dp.begin(), dp.end()) > 0) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
}
