Double Strings
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Given two strings , and little H wants to choose a subsequence from (call it ) and from (call it ) respectively. A scheme is called good iff and . Print the number of good schemes modulo .

输入描述:

The first line contains a string .

The second line contains a string .

It's guaranteed that and only contain lowercase letters.

输出描述:

Output one line only containing one integer, denoting the answer.
示例1

输入

复制
ib
coe

输出

复制
5

说明

For the first case, the 5 good schemes are:

A = \{1\}~(i), B = \{2\}~(o)_{}
A = \{2\}~(b), B = \{1\}~(c)_{}
A = \{2\}~(b), B = \{2\}~(o)_{}
A = \{2\}~(b), B = \{3\}~(e)_{}
A = \{1, 2\}~(ib), B = \{2, 3\}~(oe)_{}
示例2

输入

复制
banana
apple

输出

复制
273