<p>A <strong>valid<strong><em></em></strong>path</strong> is defined as follows:</p>
<ul>
<li>Choose array <code>nums1</code> or <code>nums2</code> to traverse (from index-0).</li>
<li>Traverse the current array from left to right.</li>
<li>If you are reading any value that is present in <code>nums1</code> and <code>nums2</code> you are allowed to change your path to the other array. (Only one repeated value is considered in the valid path).</li>
<p>Return <em>the maximum score you can obtain of all possible <strong>valid paths</strong></em>. Since the answer may be too large, return it modulo <code>10<sup>9</sup> + 7</code>.</p>