#include <bits/stdc++.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0;}
template<class T>bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0;}

using ll = long long;
using R = long double;
const R EPS = 1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r) {return (r > EPS) - (r < -EPS);}
inline R sq(R x) {return sqrt(max(x, 0.0L));}

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

// Problem Specific Parameter:
char ans[1010][1010];

int main(void) {
	int n, m, a, b;
	cin >> n >> m >> a >> b;
	rep(i, n)rep(j, m) ans[i][j] = '.';

	if (n % 2 == 1) {
		int j = 0;
		while (a > 0 and j + 1 < m) {
			ans[n - 1][j] = '<';
			ans[n - 1][j + 1] = '>';
			a--, j += 2;
		}
	}

	if (m % 2 == 1) {
		int i = 0;
		while (b > 0 and i + 1 < n) {
			ans[i][m - 1] = '^';
			ans[i + 1][m - 1] = 'v';
			b--, i += 2;
		}
	}

	if (n % 2 == 1 and m % 2 == 1 and a % 2 == 1 and b % 2 == 1) {
		const string pattern[3] = {"<>^", "^.v", "v<>"};
		rep(i, 3)rep(j, 3) ans[n - 3 + i][m - 3 + j] = pattern[i][j];
		a--, b--;
	}


	rep(i, n / 2)rep(j, m / 2) {
		if (ans[2 * i][2 * j] != '.') continue;
		if (a > 0) {
			rep(d, 2) {
				if (a > 0) {
					ans[2 * i + d][2 * j + 0] = '<';
					ans[2 * i + d][2 * j + 1] = '>';
					a--;
				}
			}
		} else if (b > 0) {
			rep(d, 2) {
				if (b > 0) {
					ans[2 * i + 0][2 * j + d] = '^';
					ans[2 * i + 1][2 * j + d] = 'v';
					b--;
				}
			}
		}
	}

	//cerr << a << " " << b << endl;
	if (a == 0 and b == 0) {
		puts("YES");
		rep(i, n) {
			rep(j, m) cout << ans[i][j];
			cout << endl;
		}
	} else {
		puts("NO");
	}

	return 0;
}
### Prompt

Please provide a Cpp coded solution to the problem described below:

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.

Examples

Input

3 4 4 2


Output

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


Input

4 5 5 3


Output

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


Input

7 9 20 20


Output

NO

### Response

```cpp
#include <bits/stdc++.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0;}
template<class T>bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0;}

using ll = long long;
using R = long double;
const R EPS = 1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r) {return (r > EPS) - (r < -EPS);}
inline R sq(R x) {return sqrt(max(x, 0.0L));}

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

// Problem Specific Parameter:
char ans[1010][1010];

int main(void) {
	int n, m, a, b;
	cin >> n >> m >> a >> b;
	rep(i, n)rep(j, m) ans[i][j] = '.';

	if (n % 2 == 1) {
		int j = 0;
		while (a > 0 and j + 1 < m) {
			ans[n - 1][j] = '<';
			ans[n - 1][j + 1] = '>';
			a--, j += 2;
		}
	}

	if (m % 2 == 1) {
		int i = 0;
		while (b > 0 and i + 1 < n) {
			ans[i][m - 1] = '^';
			ans[i + 1][m - 1] = 'v';
			b--, i += 2;
		}
	}

	if (n % 2 == 1 and m % 2 == 1 and a % 2 == 1 and b % 2 == 1) {
		const string pattern[3] = {"<>^", "^.v", "v<>"};
		rep(i, 3)rep(j, 3) ans[n - 3 + i][m - 3 + j] = pattern[i][j];
		a--, b--;
	}


	rep(i, n / 2)rep(j, m / 2) {
		if (ans[2 * i][2 * j] != '.') continue;
		if (a > 0) {
			rep(d, 2) {
				if (a > 0) {
					ans[2 * i + d][2 * j + 0] = '<';
					ans[2 * i + d][2 * j + 1] = '>';
					a--;
				}
			}
		} else if (b > 0) {
			rep(d, 2) {
				if (b > 0) {
					ans[2 * i + 0][2 * j + d] = '^';
					ans[2 * i + 1][2 * j + d] = 'v';
					b--;
				}
			}
		}
	}

	//cerr << a << " " << b << endl;
	if (a == 0 and b == 0) {
		puts("YES");
		rep(i, n) {
			rep(j, m) cout << ans[i][j];
			cout << endl;
		}
	} else {
		puts("NO");
	}

	return 0;
}
```