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

#define REP(i,n,m) for(int i=n;i<m;i++)
#define rep(i,n) REP(i,0,n)

char t[101][101];
int dx[256],dy[256];
int dp[1<<12];

int main(void){
	dx['R'] = 1;
	dx['L'] = -1;
	dy['U'] = -1;
	dy['D'] = 1;

	int hpInit,hpMax;

	while(cin>>hpInit>>hpMax && (hpInit||hpMax)){
		int H,W;
		cin>>H>>W;
		rep(i,H) cin>>t[i];

		int T;
		cin>>T;
		map<char,int> d;
		rep(i,T){
			int damage;
			char ch;
			cin>>ch>>damage;
			d[ch] = damage;
		}

		int S;
		cin>>S;
		vector<int> v;
		v.push_back(0);
		int x=0,y=0;

		rep(i,S){
			char ch;
			int n;
			cin>>ch>>n;
			rep(j,n){
				int nx = x + dx[ch];
				int ny = y + dy[ch];

				v.push_back(d[t[ny][nx]]);
				x = nx;
				y = ny;
			}
		}

		int P;
		cin>>P;
		int p[P];
		rep(i,P) cin>>p[i];

		memset(dp,-1,sizeof(dp));
		dp[0] = hpInit;

		rep(i,v.size()){
			rep(j,1<<P) if(dp[j] > 0){
				rep(k,P) if((j & (1<<k)) == 0){
					int idx = (j | (1<<k));
					dp[idx] = max(dp[idx],min(hpMax,dp[j]+p[k]));
				}
			}

			rep(j,1<<P) dp[j] -= v[i];
		}

		bool ans = false;
		rep(i,1<<P) if(dp[i] > 0){
			ans = true;
			break;
		}

		cout<<(ans?"YES":"NO")<<endl;
	}

	return 0;
}