{"raw_statement":[{"iden":"problem statement","content":"Snuke has $N$ dogs and $M$ monkeys. He wants them to line up in a row.\nAs a Japanese saying goes, these dogs and monkeys are on bad terms. _(\"ken'en no naka\", literally \"the relationship of dogs and monkeys\", means a relationship of mutual hatred.)_ Snuke is trying to reconsile them, by arranging the animals so that there are neither two adjacent dogs nor two adjacent monkeys.\nHow many such arrangements there are? Find the count modulo $10^9+7$ (since animals cannot understand numbers larger than that). Here, dogs and monkeys are both distinguishable. Also, two arrangements that result from reversing each other are distinguished."},{"iden":"constraints","content":"*   $1 ≤ N,M ≤ 10^5$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $M$"},{"iden":"sample input 1","content":"2 2"},{"iden":"sample output 1","content":"8\n\nWe will denote the dogs by `A` and `B`, and the monkeys by `C` and `D`. There are eight possible arrangements: `ACBD`, `ADBC`, `BCAD`, `BDAC`, `CADB`, `CBDA`, `DACB` and `DBCA`."},{"iden":"sample input 2","content":"3 2"},{"iden":"sample output 2","content":"12"},{"iden":"sample input 3","content":"1 8"},{"iden":"sample output 3","content":"0"},{"iden":"sample input 4","content":"100000 100000"},{"iden":"sample output 4","content":"530123477"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}