import java.util.Scanner; public class Main { static int n, s, a, b; static int f[][]; static int modnum = 100000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); s = sc.nextInt(); a = sc.nextInt(); b = sc.nextInt(); f = new int[n][n]; f[0][0] = 1; System.out.println(c()); } private static int c() { if (n == 1) return 1; for (int j = 1; j < n; j++) for (int i = 0; i < n; i++) f[i][j] = (f[g(i - j * a)][j - 1] + f[g(i + j * b)][j - 1]) % modnum; return f[g(s)][n - 1]; } private static int g(int v) { return ((v % n) + n) % n; } }