You have two strings A = A_1 A_2 ... A_n and B = B_1 B_2 ... B_n of the same length consisting of 0 and 1. The number of 1's in A and B is equal.

You've decided to transform A using the following algorithm:

* Let a_1, a_2, ..., a_k be the indices of 1's in A.
* Let b_1, b_2, ..., b_k be the indices of 1's in B.
* Replace a and b with their random permutations, chosen independently and uniformly.
* For each i from 1 to k, in order, swap A_{a_i} and A_{b_i}.



Let P be the probability that strings A and B become equal after the procedure above.

Let Z = P \times (k!)^2. Clearly, Z is an integer.

Find Z modulo 998244353.

Constraints

* 1 \leq |A| = |B| \leq 10,000
* A and B consist of 0 and 1.
* A and B contain the same number of 1's.
* A and B contain at least one 1.

Input

Input is given from Standard Input in the following format:


A
B


Output

Print the value of Z modulo 998244353.

Examples

Input

1010
1100


Output

3


Input

01001
01001


Output

4


Input

101010
010101


Output

36


Input

1101011011110
0111101011101


Output

932171449
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,a,b) for(int i=(a),_end_=(b);i<=_end_;i++)
#define DREP(i,a,b) for(int i=(a),_end_=(b);i>=_end_;i--)
#define EREP(i,u) for(int i=start[u];i;i=e[i].next)
#define fi first
#define se second
#define mkr(a,b) make_pair(a,b)
#define SZ(A) ((int)A.size())
template<class T>inline void chkmin(T &a,T b){ if(a>b)a=b;}
template<class T>inline void chkmax(T &a,T b){ if(a<b)a=b;}
inline int read()
{
	int s=0,f=1; char ch=getchar();
	while(!isdigit(ch) && ch!='-')ch=getchar();
	if(ch=='-')ch=getchar(),f=-1;
	while(isdigit(ch))s=s*10+ch-'0',ch=getchar();
	return ~f?s:-s;
}

const int maxn=1e4+20;
const int mod=998244353;

int n,m;

int f[maxn][maxn],jc[maxn],jcn[maxn],inv[maxn];

inline void init()
{
	jc[0]=jc[1]=jcn[0]=jcn[1]=inv[1]=1;
	REP(i,2,1e4)jc[i]=(ll)i*jc[i-1]%mod,inv[i]=(ll)(mod-mod/i)*inv[mod%i]%mod,jcn[i]=(ll)jcn[i-1]*inv[i]%mod;
	char A[maxn],B[maxn];
	scanf("%s",A+1);
	int len=strlen(A+1);
	scanf("%s",B+1);
	REP(i,1,len)if(A[i]=='1')
	{
		if(B[i]=='1')n++;
		else m++;
	}
}

inline void doing()
{
	f[0][0]=1;
	REP(i,0,n)REP(j,0,m)
	{
		if(i)
		{
			//f[i][j]=(f[i][j]+(ll)f[i-1][j]*i)%mod;
			if(j)f[i][j]=(f[i][j]+(ll)f[i-1][j]*i*j)%mod;
		}
		if(j)f[i][j]=(f[i][j]+(ll)f[i][j-1]*j*j)%mod;
	}
	int ans=0;
	REP(i,0,n)
	{
		ans=(ans+(ll)jc[n]*jcn[i]%mod*jcn[n-i]%mod*jc[i]%mod*jc[i]%mod*jc[n+m]%mod*jcn[i]%mod*jcn[n+m-i]%mod*f[n-i][m])%mod;
	}
	printf("%d\n",ans);
}

int main()
{
	init();
	doing();
	return 0;
}
