#ABC470F. 古戈尔交换 / Googol Swaps

古戈尔交换 / Googol Swaps

Problem Statement

You are given a string SS of length NN consisting of lowercase English letters.
Find the number, modulo 998244353998244353, of strings that SS can become after performing the following operation exactly 1010010^{100} times.

  • Choose an integer ii between 11 and MM, inclusive, and swap the AiA_i-th and BiB_i-th characters of SS.

Constraints

  • NN and MM are integers.
  • 2N2×1052 \leq N \leq 2 \times 10^5
  • 1M2×1051 \leq M \leq 2 \times 10^5
  • SS is a string of length NN consisting of lowercase English letters.
  • AiA_i and BiB_i are integers.
  • 1Ai<BiN1 \leq A_i < B_i \leq N
  • (A1,B1),,(AM,BM)(A_1, B_1), \dots, (A_M, B_M) are pairwise distinct.

Input

The input is given from Standard Input in the following format:

$N$ $M$
$S$
$A_1$ $B_1$
$\vdots$
$A_M$ $B_M$

Output

Output the answer.


5 3
miria
1 3
2 5
4 5
6

The following six strings are possible as the final SS:

  • marii
  • mirai
  • miria
  • ramii
  • rimai
  • rimia
6 6
yiwayi
1 2
1 3
2 3
4 5
4 6
5 6
18
29 25
hexakosioihexekontahexaphobia
1 2
1 4
1 6
1 8
1 15
1 16
2 3
3 4
4 20
5 6
5 8
8 22
8 23
9 15
9 17
11 21
12 20
13 19
14 29
15 28
16 17
18 19
18 21
19 20
20 21
346192062