#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
const int N = 1e5 + 7;
const int xinc[] = {0, 0, 1, -1};
const int yinc[] = {1, -1, 0, 0};
const long double PI = 3.141592653589793;
long long n;
string s;
void solve() {
  cin >> s;
  long long ans = 0;
  n = s.size();
  for (int i = 0; i < n; i++)
    if (s[i] == '1')
      ans = (ans + (power(4, n - i - 1, 1000000007) * power(2, i, 1000000007)) %
                       1000000007) %
            1000000007;
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}
