#include <bits/stdc++.h>
const double PI = acos(-1.0);
using namespace std;
char str[110];
long long tmp[110];
int main() {
  int len;
  int i;
  long long ans;
  tmp[0] = 1;
  for (i = 1; i < 110; i++) {
    tmp[i] = tmp[i - 1] * 2;
    tmp[i] %= 1000000007;
  }
  while (~scanf(" %s", str)) {
    len = strlen(str);
    ans = 0;
    for (i = 0; i < len; i++) {
      ans *= 2;
      if (str[i] == '1') {
        ans++;
      }
      ans %= 1000000007;
    }
    cout << ans * tmp[len - 1] % 1000000007 << endl;
  }
  return 0;
}
