#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  while ((c < '0' || c > '9') && c ^ '-') c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - 48;
    c = getchar();
  }
  return x * f;
}
const int N = 1e6 + 10, mo = 1e9 + 7;
char c[N];
int n;
inline int qp(int x, int y) {
  int ans = 1;
  while (y) {
    if (y & 1) ans = 1ll * ans * x % mo;
    x = 1ll * x * x % mo;
    y >>= 1;
  }
  return ans;
}
int dao[N], f[N], sum[N], g[N], top = 0;
inline int qumo(int x) { return x + ((x >> 31) & mo); }
int main() {
  scanf("%s", c + 1);
  n = strlen(c + 1);
  int las = 0;
  for (int i = 1; i <= n; i++)
    if (c[i] == '1') dao[++top] = i - las - 1, las = i;
  dao[++top] = n - las;
  if (top == 1) {
    cout << n << "\n";
    return 0;
  }
  f[1] = sum[1] = (dao[1] + 1);
  for (int i = 2; i < top; i++) {
    for (int j = 0; j <= dao[i]; j++) f[i] = qumo(f[i] + g[j] - mo);
    f[i] = (f[i] + 1ll * sum[i - 1] * (dao[i] + 1)) % mo;
    sum[i] = qumo(sum[i - 1] + f[i] - mo);
    for (int j = 0; j <= dao[i]; j++) g[j] = mo - sum[i - 1];
  }
  cout << 1ll * (dao[top] + 1) * sum[top - 1] % mo << "\n";
  return 0;
}
