#include <bits/stdc++.h>
#define int long long
using namespace std;
int ax = 0, ay = 0, bx, by, cx, cy, dp[25][25];
bool IsHorse(int x, int y)
{
return (cx - 1 == x && cy - 2 == y) ||
(cx - 2 == x && cy - 1 == y) ||
(cx - 2 == x && cy + 1 == y) ||
(cx - 1 == x && cy + 2 == y) ||
(cx + 1 == x && cy - 2 == y) ||
(cx + 2 == x && cy - 1 == y) ||
(cx + 2 == x && cy + 1 == y) ||
(cx + 1 == x && cy + 2 == y) ||
(cx == x && cy == y);
}
signed main()
{
cin >> by >> bx >> cy >> cx;
dp[0][0] = 1;
for(int i = 1; i <= bx; i++) dp[i][0] = 1;
for(int i = 1; i <= by; i++) dp[0][i] = 1;
for(int i = 1; i <= bx; i++)
{
for(int j = 1; j <= by; j++)
{
if(IsHorse(i, j)) continue;
else
{
dp[i][j] = dp[i - 1][j] * (!IsHorse(i - 1, j)) + dp[i][j - 1] * (!IsHorse(i, j - 1));
}
}
}
cout << dp[bx][by] << endl;
return 0;
}