{"problem":{"name":"Colorful Subsequence","description":{"content":"You are given a string $S$ of length $N$. Among its subsequences, count the ones such that all characters are different, modulo $10^9+7$. Two subsequences are considered different if their characters ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc031_a"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S$ of length $N$. Among its subsequences, count the ones such that all characters are different, modulo $10^9+7$. Two subsequences are considered different if their characters come from different positions in the string, even if they are the same as strings.\nHere, a subsequence of a string is a concatenation of **one or more** characters from the string without changing the order.\n\n## Constraints\n\n*   $1 \\leq N \\leq 100000$\n*   $S$ consists of lowercase English letters.\n*   $|S|=N$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc031_a","tags":[],"sample_group":[["4\nabcd","15\n\nSince all characters in $S$ itself are different, all its subsequences satisfy the condition."],["3\nbaa","5\n\nThe answer is five: `b`, two occurrences of `a`, two occurrences of `ba`. Note that we do not count `baa`, since it contains two `a`s."],["5\nabcab","17"]],"created_at":"2026-03-03 11:01:14"}}