#include <bits/stdc++.h>
using namespace std;
string s;
long long n, one, ans;
const long long mod = 1e9 + 7;
int main() {
  cin >> s;
  int n = 1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '1') {
      ans = (4 * ans + n) % mod;
    } else
      ans = (4 * ans) % mod;
    n = (2 * n) % mod;
  }
  cout << ans % mod;
  return 0;
}
