#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int sum(int a, int b) { return a + b >= MOD ? a + b - MOD : a + b; }
int sub(int a, int b) { return a - b < 0 ? a - b + MOD : a - b; }
int mul(int a, int b) { return (1LL * a * b) % MOD; }
const int MAXN = 1e6 + 7;
int shuru[MAXN], shesh[MAXN];
int zero[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  int zerosum = 1;
  int sheshsum = 0;
  int z = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '0') {
      z++;
      if (i + z == n) zerosum = sum(zerosum, 1);
      zerosum = sub(zerosum, zero[z]);
      zero[z] = shuru[i + z];
      zerosum = sum(zerosum, zero[z]);
    } else {
      z = 0;
      shesh[i] = zerosum;
      sheshsum = sum(sheshsum, shesh[i]);
      shuru[i] = sheshsum;
    }
  }
  if (z == n) {
    cout << n << "\n";
  } else {
    cout << mul(z + 1, shuru[z]) << "\n";
  }
  return 0;
}
