Java program for the above approach
import java . io . * ; import java . util . * ; class GFG { static int MOD = 1000000007 ; static Integer array [ ] = { 1 , 2 , 4 , 8 , 16 , 32 , 64 , 128 , 256 , 512 , 1024 , 2048 , 4096 } ;