//32
#include<iostream>
#include<vector>
#include<deque>

using namespace std;

struct S{
  int t,hp,u;
};

int main(){
  for(int hi,hm;cin>>hi>>hm,hi|hm;){
    int r,c;
    cin>>r>>c;
    char g[100][100];
    for(int i=0;i<r;i++){
      for(int j=0;j<c;j++){
	cin>>g[i][j];
      }
    }
    int t;
    cin>>t;
    int d[128];
    while(t--){
      char a;
      cin>>a;
      cin>>d[a];
    }
    int s;
    cin>>s;
    vector<int> v;
    int x=0,y=0;
    while(s--){
      char u;
      int n;
      cin>>u>>n;
      while(n--){
	y+=(u=='D')-(u=='U');
	x+=(u=='R')-(u=='L');
	v.push_back(d[g[y][x]]);
      }
    }
    int p[12];
    int np;
    cin>>np;
    for(int i=0;i<np;i++){
      cin>>p[i];
    }
    static int dp[1001][1<<12];
    fill(dp[0],dp[1001],0);
    deque<S> deq;
    S is={0,hi,0};
    deq.push_back(is);
    while(!deq.empty()){
      S c=deq.front();
      if(c.t==v.size())break;
      deq.pop_front();
      if(c.hp<=dp[c.t][c.u])continue;
      dp[c.t][c.u]=c.hp;
      if(v[c.t]<c.hp){
	c.hp-=v[c.t];
	c.t++;
	deq.push_back(c);
      }else{
	for(int i=0;i<np;i++){
	  if(!(c.u>>i&1)){
	    S n=c;
	    n.hp=min(hm,n.hp+p[i]);
	    n.u|=1<<i;
	    deq.push_front(n);
	  }
	}
      }
    }
    cout<<(deq.empty()?"NO":"YES")<<endl;
  }
  return 0;
}