program main implicit none integer::N,i integer*8,allocatable::course(:,:) read *,N allocate(course(1:3,1:N)) course(1,1) = 1 !ken course(2,1) = 0 !kenken course(3,1) = 0 !pa do i=2,N course(1,i) = MOD(course(3,i-1) , 10**9+7) course(2,i) = MOD(course(1,i-1) , 10**9+7) course(3,i) = MOD(course(1,i-1) + course(2,i-1), 10**9+7) end do print '(i0)',MOD(SUM(course(1:3,N)),10**9+7) end program main