// Arup Guha
// 4/22/2021
// Solution to 2021 NADC Problem G: Laptop Sticker

import java.util.*;

public class g {

	public static void main(String[] args) {
	
		// Get input.
		Scanner stdin = new Scanner(System.in);
		int w1 = stdin.nextInt();
		int h1 = stdin.nextInt();
		int w2 = stdin.nextInt();
		int h2 = stdin.nextInt();
		
		// 1 inch margins means 2 inch difference.
		if (w1-2 >= w2 && h1-2 >= h2)
			System.out.println("1");
		else
			System.out.println("0");
	}
}