#include #include #include #include using namespace std; typedef complex VEC; int main() { int n; while (cin >> n && n){ vector vv; for (int i = 0; i != n; ++i){ int x, y; cin >> x >> y; if (x == 10 || y == 10){ continue; } if (find(vv.begin(), vv.end(), VEC(x, y)) == vv.end()){ vv.push_back(VEC(x, y)); } } VEC pos(10, 10); int m; cin >> m; for (int i = 0; i != m; ++i){ char c; int counter; cin >> c >> counter; VEC dir; switch (c){ case 'N': dir = VEC(0, 1); break; case 'E': dir = VEC(1, 0); break; case 'S': dir = VEC(0, -1); break; case 'W': dir = VEC(-1, 0); break; default: cerr << "ERROR" << endl; break; } while (counter--){ pos += dir; vector::iterator it = find(vv.begin(), vv.end(), pos); if (it != vv.end()){ vv.erase(it); } } } if (vv.empty()){ cout << "Yes" << endl; } else { cout << "No" << endl; } } }