package no147; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.math.BigInteger; import java.util.Arrays; import java.util.InputMismatchException; import java.util.NoSuchElementException; public class Main { static int MAX = 80000; static long MOD = 1000000007; static BigInteger MODBI = BigInteger.valueOf(MOD); public static void main(String[] args) { IO io = new IO(); int n = io.nextInt(); long ans = 1; for(int i=0;i 0) { if ((n & 1) > 0) { res = (res * x) % mod; } x = (x * x) % mod; n/=2; } return res; } static long[][] fm = {{1,1},{1,0}}; static MatrixMod f = new MatrixMod(fm); public static long fibmod(long n,long mod) { return MatrixMod.pow(f, n).a[0][1]; } } class MatrixMod { public static final long MOD = Main.MOD; public long[][] a; public MatrixMod(long[][] a) { if (a.length == 0 || a[0].length == 0) { throw new RuntimeException("Unexpected size matrix"); } this.a = a; } public MatrixMod(long[] vector) { this(new long[vector.length][1]); for(int i=0;i0) { if (n%2==1) { X.multiplyRightToThis(M); } n/=2; if (n>0) { M.multiplyRightToThis(M); } } return X; } public MatrixMod addToThis(MatrixMod B) { set(add(this,B)); return this; } public MatrixMod multiplyThis(long c) { set(multiply(this, c)); return this; } public MatrixMod multiplyRightToThis(MatrixMod B) { set(multiply(this,B)); return this; } public MatrixMod powThis(int n) { set(pow(this, n)); return this; } public MatrixMod clone() { MatrixMod A = new MatrixMod(rows(), columns()); for(int i=0;i Integer.MAX_VALUE) { throw new NumberFormatException(); } return (int) nl; } public char nextChar() { if (!hasNext()) { throw new NoSuchElementException(); } return (char) readByte(); } public double nextDouble() { return Double.parseDouble(next());} public int[] arrayInt(int n) { int[] a = new int[n]; for(int i=0;i