2
1 31
 2
1 0
 10
450661 128600 993228 725823 293549 33490 843121 903634 556169 448234
 1
1
 5
1 3 5 7 9
 6
524 529 5249 524 529 529
 3
1 2 3
 2
0 1
 55
0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 4 5 6 7 8 9 5 6 7 8 9 6 7 8 9 7 8 9 8 9 9
 16
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
 3
128 1024 2048
 10
3 3 3 5 5 3 3 3 3 5
 1
0
 2
1 2
 2
0 0
 2
1 1

0
 2
 632
 0
 0
 24
 2
 2
 621247139
 64594
 4
 0
 1
 1
 3
 0

import java.util.Scanner;

/**
 * Created by David Lee on 2017/6/22.
 */

public class Main {
    static int P = 1000000007, N = 1<<20 + 5, k = 1<<20;
    static int a[] = new int [N];

    static private int ksm(int a, int b)
    {
        int c = 1, d = a;
        while (b > 0)
        {
            if((b & 1) != 0)
                c = (int)((long)c * d %P);
            d = (int)((long)d * d %P);
            b >>= 1;
        }
        return c;
    }

    static private void FWT(int [] a, int n, int L, int R)
    {
        if(L==R)
            return;
        int i, h = n/2;
        for (i = L; i < L + h; i++)
            a[i] = (a[i] + a[i+h])%P;
        FWT(a, h, L, L + h - 1);
        FWT(a, h, L + h, R);
    }

    static private void IFWT(int [] a, int n, int L, int R)
    {
        if(L==R)
            return;
        int i, h = n/2;
        for (i = L; i < L + h; i++)
            a[i] = (a[i] - a[i+h] + P)%P;
        IFWT(a, h, L, L + h - 1);
        IFWT(a, h, L + h, R);
    }

    static public void main(String args[]) {
        int T;
        Scanner Cin = new Scanner(System.in);
        //T = Cin.nextInt();
        T = 1;
        while (T > 0)
        {
            T--;
            int n, i;
            n = Cin.nextInt();
            for (i = 0; i < k; i++)
                a[i] = 0;
            for (i = 1; i <= n; i++)
                a[Cin.nextInt()]++;
            FWT(a, k, 0, k - 1);
            //for (i = 0; i < 10; i++)
                //System.out.printf("%d ",a[i]);
            //System.out.println();
            for (i = 0; i < k; i++)
                a[i] = ksm(2, a[i]);
            IFWT(a, k, 0, k - 1);
            System.out.printf("%d\n", a[0]);
        }
    }
}
