Integer Keys and Duplicates Given a non-empty list/vector of positive integers, write a function to check the following conditions in as few bytes as possible.


Take the first integer (the key, or k1) and check that the next k1 values have no duplicate values, excluding instances of k1. 
Take the last integer (the second key, or k2) and check that the k2 values before k2 have no duplicate values, excluding instances of k2.


Note that both keys, k1 and k2, are elements of the list/vector as either key could contain the other.

Also, k1 and/or k2 can be greater than the number of integers within the list, which means you should check every element of the list except for instances of the given key for duplicates. 

If both steps return True, return True, else, return False.

NOTE: It should be rather intuitive that searching for duplicates within the first k1+1 elements excluding instances of k1 will exclude the first element, or k1. Some answers I've seen "pop" k1 off the list and do the test on the next k1 elements. Either method yields the same results. This is also true for k2 and it's test.

Test Cases

[5,1,2,5,3,4,3] is TRUE because [k1=5][1,2,5,3,4] has no duplicates, nor does [5,3,4][k2=3] have any duplicates, excluding instances of k3. 

[6,9,12,15,18,19,8,8,3] is FALSE because [k1=6][9,12,15,18,19,8] has no duplicates while [19,8,8][k2=3] has a duplicate.

[100,100,100,100,101,102,3] is TRUE because [k1=100][100,100,100,101,102,3] has no duplicates, and [100,101,102][k2=3] has no duplicates.

[100,100,100,100,101,102,4] is FALSE. [k1=100][100,100,100,101,102,4] has no duplicates, but [100,100,101,102][k2=4] has duplicates.

[6,6,6,6,6,6,6,3,3,3,3] is TRUE. [k1=6][6,6,6,6,6,6] has no duplicates, excluding instances of k1, and [3,3,3][k2=3] has no duplicates, excluding instances of k2.

[1,2] is TRUE (clearly)

[1] is TRUE (clearly)
JavaScript (ES6),  88 75 71  69 bytes

a=&gt;(g=_=&gt;!a.reverse().some(o=(v,i,[k])=&gt;v-k&amp;&amp;o[v]&amp;(o[v]=i&lt;=k)))()&amp;g()

Try it online!
Commented
The function \$g\$ reverses the input array and performs the test with the resulting leading key.
g= _ =&gt;               // g takes no explicit input
  !a.reverse()        // reverse the input array a[]
  .some(o =           // we use the object o to store encountered values
    (v, i,            // for each value v at position i in a[],
           [k]) =&gt;    // with k = leading value:
      v - k &amp;&amp;        //   abort if v is equal to the key
      o[v] &amp;          //   otherwise, test whether o[v] is already set
      (o[v] = i &lt;= k) //   and i is less than or equal to the key,
                      //   in which case o[v] is set
  )                   // end of some()

The main function simply invokes \$g\$ twice.
a =&gt; g() &amp; g()