from math import *
F = [0] * (10 ** 6 + 1)
def init():
F[0] = 0
F[1] = 1
for i in range( 2, 10 ** 6 + 1):
F[i] = F[i - 1] + F[i - 2]
F[i] %= (10 ** 9 + 7)
if __name__ == '__main__':
init()
t = int(input())
for i in range(t):
n = int(input())
print(F[n])
ZnJvbSBtYXRoIGltcG9ydCAqCkYgPSBbMF0gKiAoMTAgKiogNiArIDEpCmRlZiBpbml0KCk6CiAgICBGWzBdID0gMAogICAgRlsxXSA9IDEKICAgIGZvciBpIGluIHJhbmdlKCAyLCAxMCAqKiA2ICsgMSk6CiAgICAgICAgRltpXSA9IEZbaSAtIDFdICsgRltpIC0gMl0KICAgICAgICBGW2ldICU9ICgxMCAqKiA5ICsgNykKICAgIAoKaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzoKICAgIGluaXQoKQogICAgdCA9IGludChpbnB1dCgpKQogICAgZm9yIGkgaW4gcmFuZ2UodCk6CiAgICAgICAgbiA9IGludChpbnB1dCgpKQogICAgICAgIHByaW50KEZbbl0pCiAgICAK