#include<cstdio>
#include<vector>

#define	mp			make_pair
#define	pb			push_back
#define	rep(i,n)	for(int i=0;i<n;i++)

using namespace std;

typedef	vector<int>		vi;
typedef	vector<vi>		vvi;
typedef	pair<int,int>	pii;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	for(int hpinit,hpmax;scanf("%d%d",&hpinit,&hpmax),hpinit;){
		int m,n,tmp;	scanf("%d%d",&m,&n);

		vvi trap(m,vi(n));
		{
			char a[100][101];
			rep(i,m)	scanf("%s",a+i);
			int tmp;	scanf("%d ",&tmp);
			int f[128];
			rep(i,tmp){
				char ch;
				int dmg;	scanf("%c%d ",&ch,&dmg);
				f[ch]=dmg;
			}
			rep(i,m)rep(j,n)	trap[i][j]=f[a[i][j]];
		}

		scanf("%d ",&tmp);
		vector<pii> step(tmp);
		rep(i,tmp){
			char ch;
			int d;	scanf("%c%d ",&ch,&d);
			char f[128];
			f['R']=0,f['U']=1,f['L']=2,f['D']=3;
			step[i]=mp(d,f[ch]);
		}
		step.pb(mp(1,0));	// dummy

		int psize;	scanf("%d",&psize);
		vi por(psize);
		rep(i,psize)	scanf("%d",&por[i]);

		vi cure(1<<psize);
		rep(i,1<<psize)rep(j,psize){
			if(i&(1<<j))	cure[i]+=por[j];
		}

		int x=0,y=0;
		vi hp(1<<psize);	hp[(1<<psize)-1]=hpinit;
		rep(t,step.size())rep(k,step[t].first){
			int dmg=trap[y][x];
			rep(i,1<<psize){
				if(hp[i]<=0)	continue;
				if(hp[i]<=dmg){
					rep(j,i){
						if((j&i)==j){	// stat j is a subset of stat i
							hp[j]=max(hp[j],min(hp[i]+cure[i&~j],hpmax)-dmg);
						}
					}
				}
				hp[i]-=dmg;
			}
			int dir=step[t].second;
			x+=dx[dir];	y+=dy[dir];
		}

		bool ok=false;
		rep(i,1<<psize) if(hp[i]>0){ ok=true; break; }
		puts(ok?"YES":"NO");
	}

	return 0;
}