{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"A Palindrome string is a string which reads the same backward as forward, such as _madam_ or _racecar_.\n\nThere is a problem about the palindrome string again.\n\nWe define the **palindrome level** of a string $S$ equals the number of the distinct palindrome substrings of $S$. \n\nFor example, \"aa\u0027\u0027 has the palindrome level $2$ and \"aba\u0027\u0027 has the palindrome level $3$.\n\nConsider all the strings with the length $N$ and the charset size $M$, calculate the sum of their palindrome levels."}},{"title":"Input","value":{"format":"MD","content":"Only one line contains two integers $N$ and $M$.\n\n$1 \\leq N \\leq 100$, $1 \\leq M \\leq 10^9$."}},{"title":"Output","value":{"format":"MD","content":"Print the corresponding answer modulo $10^9 + 7$."}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e24\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2 3\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e18\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}