{"problem":{"name":"ABBreviate","description":{"content":"There is a string $s$ consisting of `a` and `b`. Snuke can perform the following two kinds of operation any number of times in any order: *   Choose an occurrence of `aa` as a substring, and replace ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc027_e"},"statements":[{"statement_type":"Markdown","content":"There is a string $s$ consisting of `a` and `b`. Snuke can perform the following two kinds of operation any number of times in any order:\n\n*   Choose an occurrence of `aa` as a substring, and replace it with `b`.\n*   Choose an occurrence of `bb` as a substring, and replace it with `a`.\n\nHow many strings $s$ can be obtained by this sequence of operations? Find the count modulo $10^9 + 7$.\n\n## Constraints\n\n*   $1 \\leq |s| \\leq 10^5$\n*   $s$ consists of `a` and `b`.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$s$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc027_e","tags":[],"sample_group":[["aaaa","6\n\nSix strings can be obtained:\n\n*   `aaaa`\n*   `aab`\n*   `aba`\n*   `baa`\n*   `bb`\n*   `a`"],["aabb","5\n\nFive strings can be obtained:\n\n*   `aabb`\n*   `aaa`\n*   `bbb`\n*   `ab`\n*   `ba`"],["ababababa","1\n\nSnuke cannot perform any operation."],["babbabaaba","35"]],"created_at":"2026-03-03 11:01:13"}}