#include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,1,0,-1 };
map<char,int> dmp;

int dp[1010][9200];
int main() {
	dmp['L'] = 0;
	dmp['D'] = 1;
	dmp['R'] = 2;
	dmp['U'] = 3;
	while (1) {
		int init, amax; cin >> init >> amax;
		if (!init)break;
		int R, C; cin >> R >> C;
		vector<string>fi;
		for (int i = 0; i < R; ++i) {
			string st; cin >> st;
			fi.push_back(st);
		}
		int T; cin >> T;
		map<char, int>mp;
		for (int i = 0; i < T; ++i) {
			char c; int a; cin >> c >> a;
			mp[c] = a;
		}
		int S; cin >> S;

		int nx = 0;
		int ny = 0;
		vector<int>damages;
		damages.push_back(0);
		for (int i = 0; i < S; ++i) {
			char c; int a;
			cin >> c >> a;
			int way = dmp[c];
			for (int j = 0; j < a; ++j) {
				nx += dx[way];
				ny += dy[way];
				damages.push_back(mp[fi[ny][nx]]);
			}
		}
		int P; cin >> P;
		vector<int>ps;
		for (int i = 0; i < P; ++i) {
			int a; cin >> a;
			ps.push_back(a);
		}
		sort(ps.begin(), ps.end());
		reverse(ps.begin(), ps.end());
		for (int i = 0; i < 1010; ++i) {
			for (int j = 0; j < 9200; ++j) {
				dp[i][j] = 0;
			}
		}
		dp[0][0] = init;
		for (int i = 0; i < damages.size(); ++i) {
			for (int j = 0; j < 1 << P; ++j) {
				dp[i][j] -= damages[i];
				dp[i][j] = max(0, dp[i][j]);
			}
			for (int j = 0; j < 1 << P; ++j) {
				if (dp[i][j]) {

					bitset<12>bs(j);
					for (int k = 0; k < P; ++k) {
						if (!bs[k]) {
							bs[k] = true;
							dp[i][bs.to_ulong()] = max(dp[i][bs.to_ulong()], min(dp[i][j] + ps[k], amax));
							bs[k] = false;
						}
					}
				}
			}
			for (int j = 0; j < 1 << P; ++j) {
				dp[i + 1][j] = dp[i][j];
			}
		}
		string ok = "NO";
		for (int i = damages.size(); true; ++i) {
			
			for (int j = 0; j < 1 << P; ++j) {
				if (dp[i][j]>0) {
					ok = "YES";
					break;
				}
			}
			break;
		}
		cout << ok << endl;
	}
	return 0;
}