package no189; import java.util.Scanner; public class Main { public static final long MOD = 1000000009; public static void main(String[] args) { Scanner sc = new Scanner(System.in); long[] m = count(sc.next()); long[] d = count(sc.next()); long ans = 0; for(int i=1;i<=2000;i++) { ans = (ans + m[i] * d[i]) % MOD; } System.out.println(ans); } public static long[] count(String s) { int n = s.length(); int[] d = new int[n]; for(int i=0;i k) { dp[i+1][1][j+k] += dp[i][0][j]; }else if(d[i] == k) { dp[i+1][0][j+k] += dp[i][0][j]; } dp[i+1][0][j+k] %= MOD; dp[i+1][1][j+k] %= MOD; } } // System.out.println(i); // System.out.println(Arrays.toString(dp[i][0])); // System.out.println(Arrays.toString(dp[i][1])); } long[] ret = new long[2020]; for(int i=0;i<202;i++) { ret[i] = (dp[n][0][i] + dp[n][1][i]) % MOD; } return ret; } }