#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int64_t res = 0, res1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '1') {
      res1 = 1;
      for (int j = 0; j < i; j++) res1 = (res1 * 2) % 1000000007;
      for (int j = 0; j < s.size() - i - 1; j++) res1 = (res1 * 2) % 1000000007;
      for (int j = 0; j < s.size() - i - 1; j++) res1 = (res1 * 2) % 1000000007;
      res = (res + res1) % 1000000007;
    }
  }
  cout << res;
}
