#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/
int ihp, mhp;
int p;
vi portion, dmg; 
vector<vi> fld;
int dp[1111][4444];

bool solve()
{
	dp[0][0] = ihp;
	REP(i, dmg.size())
	{
		REP(j, 1 << p)
		{
			if (dp[i][j] == 0) continue;
			chmax(dp[i + 1][j], dp[i][j] - dmg[i]);
			REP(k, p)
			{
				if (!((j >> k) & 1))
				{
					chmax(dp[i][j | (1 << k)], min(mhp, dp[i][j] + portion[k]));
				}
			}
		}
	}
	return dp[dmg.size()][(1 << p) - 1] > 0;
}


int main()
{
	while (cin >> ihp >> mhp, ihp)
	{
		portion.clear();
		dmg.clear();
		fld.clear();
		MS(dp, 0);
		int h, w;
		cin >> h >> w;
		fld.resize(h, vi(w));
		vs fldc(h);
		REP(i, h) cin >> fldc[i];
		int t; cin >> t;
		int mp[26];
		REP(i, t)
		{
			char c; int d;
			cin >> c >> d;
			mp[c - 'A'] = d;
		}
		REP(i, h)REP(j, w)
		{
			fld[i][j] = mp[fldc[i][j] - 'A'];
		}

		int tx = 0, ty = 0;
		int s; cin >> s;
		REP(i, s)
		{
			char c; int d;
			cin >> c >> d;
			pii tmp;
			if (c == 'U') tmp = pii(-1, 0);
			if (c == 'D') tmp = pii(1, 0);
			if (c == 'L') tmp = pii(0, -1);
			if (c == 'R') tmp = pii(0, 1);
			REP(j, d)
			{
				tx += tmp.first, ty += tmp.second;
				dmg.push_back(fld[tx][ty]);
			}
		}
		cin >> p;
		REP(i, p)
		{
			int a; cin >> a;
			portion.push_back(a);
		}
		puts(solve() ? "YES" : "NO");
	}
	return 0;
}