import Data.Bits

solve :: [Int] -> Mint
solve as = sum $ map f [0..59] where
  f :: Int -> Mint
  f i = M one * M zro * 2^i where
    one = length $ filter (`testBit` i) as
    zro = length as - one

main=getLine>>getLine>>=print.solve.map read.words

modulus = 10^9+7
newtype Mint = M Int
instance Enum Mint where
  fromEnum(M a) = a
  toEnum a = M$ mod a modulus
instance Num Mint where
  (M a)+(M b) = toEnum$ a+b
  (M a)*(M b) = toEnum$ a*b
  (M a)-(M b) = toEnum$ a-b
  fromInteger = toEnum . fromInteger
  abs = id
  signum = const (M 1)
instance Show Mint where
  show (M a) = show a
