#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
using Pll = pair<P, long long>;
using PQ = priority_queue<P, vector<P>, greater<P>>;
string binary_expansion(string &s) {
  string t;
  long long pre_temp = 0, temp = 0;
  bool flag = false;
  for (long long i = 0; i < 60; i++) t += '0';
  for (long long i = 0; i < 60; i++) {
    for (long long j = 0; j < s.size(); j++) {
      if (s[j] != '0')
        break;
      else if (j == s.size() - 1)
        flag = true;
    }
    if (flag) break;
    if ((s[s.size() - 1] - '0') % 2 == 0)
      t[59 - i] = '0';
    else
      t[59 - i] = '1';
    pre_temp = 0;
    temp = 0;
    for (long long j = 0; j < s.size(); j++) {
      if ((s[j] - '0') % 2 == 1)
        temp = 1;
      else
        temp = 0;
      s[j] = ((10 * pre_temp + (s[j] - '0')) / 2) + '0';
      pre_temp = temp;
    }
  }
  return t;
}
long long string_xor(string s, string t) {
  string a1 = binary_expansion(s);
  string a2 = binary_expansion(t);
  long long res = 0;
  for (long long i = 0; i < 60; i++) {
    if (a1[59 - i] != a2[59 - i]) {
      res += (long long)pow(2, i) % (long long)(1e9 + 7);
      res %= (long long)(1e9 + 7);
    }
  }
  return res;
}
int main() {
  long long n;
  cin >> n;
  string s[n];
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (long long i = 0; i < n - 1; i++) {
    for (long long j = i + 1; j < n; j++) {
      ans += string_xor(s[i], s[j]);
      ans %= (long long)(1e9 + 7);
    }
  }
  cout << ans << endl;
  return 0;
}
