/*
Jackson Simoneau
SI@UCF 2026 - Intro to Competitive Programming

Solution to https://open.kattis.com/problems/laptopsticker
*/

#include <bits/stdc++.h>
using namespace std;

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if(c <= a-2 && d <= b-2) {
        cout << 1 << endl;
    } else {
        cout << 0 << endl;
    }
}