Problem:
Score : 900 points

Problem Statement

Takahashi has an N \times M grid, with N horizontal rows and M vertical columns.
Determine if we can place A 1 \times 2 tiles (1 vertical, 2 horizontal) and B 2 \times 1 tiles (2 vertical, 1 horizontal) satisfying the following conditions, and construct one arrangement of the tiles if it is possible:

All the tiles must be placed on the grid.

Tiles must not stick out of the grid, and no two different tiles may intersect.

Neither the grid nor the tiles may be rotated.

Every tile completely covers exactly two squares.

Constraints

1 \leq N,M \leq 1000

0 \leq A,B \leq 500000

N, M, A and B are integers.

Input

Input is given from Standard Input in the following format:

N M A B

Output

If it is impossible to place all the tiles, print NO.
Otherwise, print the following:

YES
c_{11}...c_{1M}
:
c_{N1}...c_{NM}

Here, c_{ij} must be one of the following characters: ., <, >, ^ and v. Represent an arrangement by using each of these characters as follows:

When c_{ij} is ., it indicates that the square at the i-th row and j-th column is empty;

When c_{ij} is <, it indicates that the square at the i-th row and j-th column is covered by the left half of a 1 \times 2 tile;

When c_{ij} is >, it indicates that the square at the i-th row and j-th column is covered by the right half of a 1 \times 2 tile;

When c_{ij} is ^, it indicates that the square at the i-th row and j-th column is covered by the top half of a 2 \times 1 tile;

When c_{ij} is v, it indicates that the square at the i-th row and j-th column is covered by the bottom half of a 2 \times 1 tile.

Sample Input 1

3 4 4 2

Sample Output 1

YES
<><>
^<>^
v<>v

This is one example of a way to place four 1 \times 2 tiles and three 2 \times 1 tiles on a 3 \times 4 grid.

Sample Input 2

4 5 5 3

Sample Output 2

YES
<>..^
^.<>v
v<>.^
<><>v

Sample Input 3

7 9 20 20

Sample Output 3

NO

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

//#pragma GCC optimize("trapv")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,tune=native")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
using namespace std;
using ll = long long;
//using arr = array;
using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vpi = vector<pi>;
using ld = long double;
const int maxn = 1010, mod = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
char ans[maxn][maxn];
int _n, _m, a, b, flag = 0;
void vput(int x, int y) {
	ans[x][y] = 'v';
	ans[x-1][y] = '^';
}
void hput(int x, int y) {
	ans[x][y] = '<';
	ans[x][y+1] = '>';
}
void print() {
	if(flag) {
		hput(_n-1, _m-2);
		vput(_n-1, _m-3);
	}
	cout << "YES\n";
	for(int i = 0; i < _n; i++, cout << '\n')
		for(int j = 0; j < _m; j++)
			cout << ans[i][j];
	exit(0);
}
void next(int n, int m, int &cx, int &cy) {
	if(cx+3 < n) cx += 2;
	else cx = 0, cy += 2;
}
void solve(int n, int m, int a, int b) {
	if((a+b) > n*m/2) return;
	if((a+b) == n*m/2 && (n%2)+(m%2)==0 && (a&1) && (b&1)) return;
	if(n*m == 0 && a+b) return;
	if(n&1) {
		for(int i = 0, x = a; i+1 < m && x--; i+=2) hput(n-1, i);
		solve(n - 1, m, max(0, a - (m/2)), b);
		for(int i = 0; i < m; i++) ans[n-1][i] = '.';
	}
	if(m&1) {
		for(int i = 1, x = b; i < n && x--; i+=2) vput(i, m-1);
		solve(n, m - 1, a, max(0, b - (n/2)));
		for(int i = 1; i < n; i++) ans[i][m-1] = '.';
	}
	
	if((n%2)+(m%2)) {solve(n - (n&1), m - (m&1), a, b); return;}
	int A = a/2, B = b/2;
	int cx = 0, cy = 0;
	while(A||B) {
		if(A) {
			hput(cx, cy);
			hput(cx+1, cy);
			A--;
		} else {
			vput(cx+1, cy);
			vput(cx+1, cy+1);
			B--;
		}
		next(n, m, cx, cy);
	}
	if(a&1) {
		hput(cx, cy);
		next(n, m, cx, cy);
	}
	if(b&1) {
		vput(cx+1, cy);
		next(n, m, cx, cy);
	}
	print();
}
int main() {
	cin.tie(0)->sync_with_stdio(0);
	memset(ans, '.', sizeof ans);
	cin >> _n >> _m >> a >> b;
	if((_n&_m&(a|b)&1) && _n*_m-2*(a+b)==1) {
		b--;
		flag = 1;
	}
	solve(_n, _m, a, b);
	cout << "NO\n";
}