#include <bits/stdc++.h>
struct strgrp {
  strgrp(long long l, long long c) : lengthZero(l), cnt(c) {}
  long long lengthZero, cnt;
};
const long long MOD = 1e9 + 7;
std::string s;
std::vector<long long> blocks;
std::stack<strgrp> endZero;
int main() {
  std::ios::sync_with_stdio(false);
  std::cout.tie(nullptr);
  std::cin.tie(nullptr);
  std::cin >> s;
  int n = s.length();
  if (s.find('1') == std::string::npos) {
    std::cout << n << '\n';
    return 0;
  }
  for (int iChr = 0; iChr < n; iChr++) {
    if (s[iChr] == '1')
      blocks.emplace_back(0);
    else {
      int jChr = iChr;
      while (jChr < n && s[jChr] == '0') jChr++;
      blocks.emplace_back(jChr - iChr);
      iChr = jChr - 1;
    }
  }
  int mult = 1;
  if (blocks[0] != 0) {
    mult = (blocks[0] + 1);
    blocks.erase(blocks.begin());
  }
  long long maxOne = 1, maxZero = 0;
  long long gen = 0;
  for (long long block : blocks) {
    if (block == 0) {
      maxOne = (maxOne + maxZero) % MOD;
      maxZero = 0;
      gen = (gen + maxOne) % MOD;
      endZero.emplace(0, maxOne);
    }
    long long nxtMax = 0;
    while (!endZero.empty() && endZero.top().lengthZero <= block) {
      nxtMax = (nxtMax + endZero.top().cnt) % MOD;
      maxZero =
          (maxZero + (block - endZero.top().lengthZero) * endZero.top().cnt) %
          MOD;
      endZero.pop();
    }
    endZero.emplace(block, nxtMax);
  }
  while (!endZero.empty()) {
    gen = (gen + endZero.top().cnt * blocks.back()) % MOD;
    endZero.pop();
  }
  std::cout << (gen * mult) % MOD << '\n';
  return 0;
}
