Now, you are playing a simple game. Given an array A of length n, your task is to control a robot to move or stop in this array.
Initially, the position of the robot is randomly selected: the probability for selecting position i∈\[1,n] is n1. In each turn, you know the current position, and need to make a decision between two action choices:
Since the second action can be selected only when the robot is not at either end of the array, we can prove that, for any strategy, lim_m→+∞f(m)=0, where f(m) represents the probability that the game continues after m turns.
Your task is to maximize the expected score of the game.
The first line contains a single integer n (1≤n≤5⋅105).
The second line contains n integers A_1,A_2,…,A_n (1≤A_i≤1012).
Output a single line with a single integer: the maximum possible expected score as a fraction modulo 998,244,353. In other words, it can be proven that the answer can be expressed as a rational number P/Q where Q is coprime with 998,244,353, and you must output (P⋅Q−1)mod998,244,353.