#include <bits/stdc++.h>
using namespace std;
const int N = int(1e6) + 5;
const int mo = int(1e9) + 7;
int n;
char s[N];
int cnt0[N], nexcnt0[N], f[N];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) s[i] -= '0';
  for (int i = 1; i <= n; i++)
    if (s[i] == 0) cnt0[i] = cnt0[i - 1] + 1;
  for (int i = 0; i <= n + 1; i++) nexcnt0[i] = n + 1;
  for (int i = n; i >= 1; i--) {
    f[i] =
        ((cnt0[i] <= cnt0[n]) + f[nexcnt0[cnt0[i] + 1]] + f[nexcnt0[0]]) % mo;
    nexcnt0[cnt0[i]] = i;
  }
  printf("%d\n",
         nexcnt0[0] <= n ? int((long long)f[nexcnt0[0]] * nexcnt0[0] % mo) : n);
}
