#include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef pair<int,int> pr;
int main() {
	// your code goes here
	int w,h;
	while(cin >> w >> h && w!=0){
	int xs,ys,xg,yg,n,m,s,sum,c,d,x,y;
	int dx[]={0,1,-1,0},dy[]={1,0,0,-1};
	cin >> xs>>ys>>xg>>yg >> n;
	bool map[102][102]={};	
	int color[102][102]={};
	queue<pr> q;
		color[xs][ys]=10;
		for(int i=0;i<n;i++){
			cin >> c >> d >>x >> y;
			for(int j=0;j<2+d*2;j++)
				for(int k=0;k<4-d*2;k++)
					color[x+k][y+j]=c;
		}
		map[xs][ys]=true;
		q.push(pr(xs,ys));
		while(!q.empty()){
			int f=q.front().first,s=q.front().second;
			q.pop();
			for(int i=0;i<4;i++){
					if(color[f][s]==color[f+dx[i]][s+dy[i]] && !map[f+dx[i]][s+dy[i]]){
						q.push(pr(f+dx[i],s+dy[i]));
						map[f+dx[i]][s+dy[i]]=true;
					}
			}
		}
		if(map[xg][yg])
		cout << "OK" << endl;
		else
		cout << "NG" << endl;
	}
	return 0;
}
#include <iostream>
#include <cstdio>
using namespace std;


int main()
{
  int n, m;
  int x[20];
  int y[20];
  char d[30];                   // ??????
  int s[30];                    // ?§???????

  bool grid[21][21];

  while (1)
  {
    cin >> n;
    if (n == 0) return 0;
    for (int i=0;i<n;i++) cin >> x[i] >> y[i];
    cin >> m;
    for (int i=0;i<m;i++) cin >> d[i] >> s[i];

    for (int i=0;i<21;i++)
      for (int j=0;j<21;j++) grid[i][j]=false;

    int posx = 10, posy = 10;
    grid[posx][posy]=true;

    for (int i=0;i<m;i++)
    {
      for (int k=0;k<s[i];k++)
      {
        switch (d[i])
        {
        case 'E': posx = min(posx+1, 20); break;
        case 'W': posx = max(posx-1, 0); break;
        case 'N': posy = min(posy+1, 20); break;
        case 'S': posy = max(posy-1, 0); break;
        }
        grid[posx][posy]=true;
      }
    }

    int r=n;
    for (int i=0;i<n;i++)
      if (grid[x[i]][y[i]]) r--;
    if (r==0) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}