#include <bits/stdc++.h>
using namespace std;
const long long logN = 20;
const long long N = 100005;
const long long M = 1000000007;
const long long dx[4] = {1, 0, -1, 0};
const long long dy[4] = {0, 1, 0, -1};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  reverse(s.begin(), s.end());
  long long ans = 0, cnt = 1;
  for (auto i : s) {
    if (i == '1') {
      ans = (2 * ans + cnt) % M;
    } else {
      ans = (2 * ans) % M;
    }
    cnt = (cnt * 4) % M;
  }
  cout << ans << "\n";
  return 0;
}
