#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, N = 1000010;
char s[N];
int n, ans, f[N], F[N], mk[N];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; ++i) {
    if (s[i] == '1') {
      int len = i - mk[0] - 1;
      if (!mk[0]) f[i] = i;
      for (int j = 0; j <= len; ++j) {
        f[i] = ((long long)mod + f[i] + F[i - 1] - (mk[j] ? F[mk[j] - 1] : 0)) %
               mod;
        mk[j] = i;
      }
    }
    F[i] = (F[i - 1] + f[i]) % mod;
  }
  ans = mk[0] ? (1LL * F[n] * (n - mk[0] + 1) % mod) : n;
  cout << ans << endl;
}
