#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAXN = 1000005;
char s[MAXN];
int n, nxt[MAXN];
long long dp[MAXN], A[MAXN];
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = n; i >= 0; i--) {
    if (i == n)
      nxt[i] = -1;
    else {
      if (s[i] == '1')
        nxt[i] = i;
      else
        nxt[i] = nxt[i + 1];
    }
  }
  int j = -1;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '1') {
      j = i;
      break;
    }
  }
  if (j == -1) {
    printf("%d\n", n);
    return 0;
  }
  int m = j + 1;
  long long r0 = 0;
  for (int i = m; i >= 0; i--) {
    if (i == m)
      dp[i] = 1;
    else {
      int l = nxt[i] - i;
      if (l > 0) {
        r0 = (r0 - A[l] + MOD) % MOD;
        A[l] = dp[nxt[i] + 1];
        r0 = (r0 + A[l]) % MOD;
      }
      dp[i] = (r0 + dp[nxt[i] + 1] + 1) % MOD;
    }
  }
  int k = nxt[0];
  long long res = dp[k + 1] * (n - m + 1) % MOD * (k + 1) % MOD;
  printf("%lld\n", res);
  return 0;
}
