#include <iostream>
#include <fstream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

#define EPS 1e-9
#define INF MOD
#define MOD 1000000007LL
#define fir first
#define iss istringstream
#define sst stringstream
#define ite iterator
#define ll long long
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pi pair<int,int>
#define pb push_back
#define sec second
#define sh(i) (1LL<<i)
#define sz size()
#define vi vector<int>
#define vc vector
#define vl vector<ll>
#define vs vector<string>

int hpi,hpm,R,C,T,S,n[1010],P,p[19],x,y,dy[]={0,1,0,-1},dx[]={1,0,-1,0},dp[1<<12];
char a[110][110],d[1010],c;
map<char,int> M,m;
vi v;
int tc;
int main(){
	m['R']=0,m['D']=1,m['L']=2,m['U']=3;
	while(cin>>hpi>>hpm&&hpi){tc++;
		v.clear();
		cin>>R>>C;
		rep(i,R)cin>>a[i];
		cin>>T;
		rep(i,T)cin>>c>>y,M[c]=y;
		cin>>S;
		rep(i,S)cin>>d[i]>>n[i];
		cin>>P;
		rep(i,P)cin>>p[i];
		y=x=0;
		rep(i,S){
			rep(j,n[i]){
				y+=dy[m[d[i]]],x+=dx[m[d[i]]];
				if(M[a[y][x]])v.pb(M[a[y][x]]);
			}
		}
		fill(dp,dp+(1<<P),-INF);
		dp[0]=hpi;
		rep(i,v.sz)rep(j,1<<P)if(dp[j]>0){
			rep(k,P)if(!(j&1<<k)){
				dp[j|1<<k]=max(dp[j|1<<k],min(hpm,dp[j]+p[k]));
			}
			dp[j]-=v[i];
		}
		cout<<(dp[(1<<P)-1]>0||!v.sz?"YES":"NO")<<endl;
	}
}