I asked this question on Mathematics Stackexchange, but got no answer.

Let $\mathcal A$ and $\mathcal B$ be nonempty categories whose categories $\mathcal A^{\mathcal A}$ and $\mathcal B^{\mathcal B}$ of endofunctors are equivalent.

Are $\mathcal A$ and $\mathcal B$ necessarily equivalent?

Implicit assumption: we are working in ZFC, and we assume that ZFC is consistent.

If my understanding is correct, this post of Joel David Hamkins implies that one cannot prove that the answer is Yes, so that either the answer is No, or the question is undecidable. (I think that the answer is No.)

[Reminder 1: Categories are generalized sets in the following sense. Given a set $S$ let $\mathcal C(S)$ be the category whose objects are the elements of $S$ and whose only morphisms are the identity morphisms. Then the assignment $S\mapsto\mathcal C(S)$ commutes with exponentials in the obvious sense.]

[Reminder 2: Infinite cardinals $\kappa$ satisfy $\kappa^\kappa=2^\kappa$. Indeed $\kappa^\kappa\le(2^\kappa)^\kappa=2^{\kappa\kappa}=2^\kappa\le\kappa^\kappa$.]