#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;

int main(){
	map<char, int> dx,dy;
	dx['U']=0; dy['U']=-1;
	dx['D']=0; dy['D']=1;
	dx['L']=-1; dy['L']=0;
	dx['R']=1; dy['R']=0;

	while(1){
		int hp,hpmax;
		cin >> hp >> hpmax;
		if(hp == 0) break;

		int h,w;
		cin >> h >> w;
		vector<string> field(h);
		for(int i=0; i<h; i++){
			cin >> field[i];
		}
		int t;
		cin >> t;
		vector<int> damage(256, 0);
		for(int i=0; i<t; i++){
			char c;
			int d;
			cin >> c >> d;
			damage[c] = d;
		}
		int s;
		cin >> s;
		vector<int> damageseq;
		int x=0,y=0;
		for(int i=0; i<s; i++){
			char dir;
			int num;
			cin >> dir >> num;
			for(int j=0; j<num; j++){
				x+=dx[dir];
				y+=dy[dir];
				if(damage[field[y][x]] > 0){
					damageseq.push_back(damage[field[y][x]]);
				}
			}
		}
		int p;
		cin >> p;
		vector<int> portion(p);
		for(int i=0; i<p; i++){
			cin >> portion[i];
		}

		vector<vector<int> > dp(damageseq.size()+1, vector<int>(1<<p, 0));
		dp[0][0] = hp;
		for(int i=0; i<(int)damageseq.size(); i++){
			for(int j=0; j<(1<<p); j++){
				if(dp[i][j] <= 0) continue;
				dp[i+1][j] = max(dp[i+1][j], dp[i][j]-damageseq[i]);
				for(int k=0; k<p; k++){
					if(j>>k & 1) continue;
					int newhp = min(dp[i][j]+portion[k], hpmax);
					dp[i][j|(1<<k)] = max(dp[i][j|(1<<k)], newhp);
				}
			}
		}
		bool yes = false;
		for(int i=0; i<(1<<p); i++){
			if((dp.back())[i] > 0) yes = true;
		}
		if(yes){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}
