proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" .} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': break result = 10 * result + k.ord - '0'.ord const MOD = 1_0000_0000_7 let n = scan() var dp1 = newSeq[int](n.max(10)+1) var dp2 = newSeq[int](n.max(10)+1) var dp3 = newSeq[int](n.max(10)+1) dp1[1] = 1 # 1 dp2[2] = 1 # 2 dp3[3] = 1 # 3 for i in 1..n: if i+1