Count binary strings of length n with no 3 consecutive identical characters, mod 10^9+7. f(0)=1, f(1)=2, f(2)=4.
Input: A non-negative integer n.
Output: Integer mod 10^9+7.
Input: 3
Output: 6
Explanation: All 8 except 000, 111 -> 6.Input: 1
Output: 2
Explanation: 0, 1.Input: 0
Output: 1
Explanation: Empty string.0 <= n <= 1000