<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described.
<END_TASK>
<USER_TASK:>
Description:
Count subarrays consisting of first K natural numbers in descending order
Function to count subarray having the decreasing sequence K to 1 ; Traverse the array ; Check if required sequence is present or not ; Reset temp to k ; Return the count ; Driver Code ; Function Call

<ASSISTANT_TASK:>
Python Code:
def CountSubarray(arr , n , k ) : 
	 temp = k 
 count = 0 
 for i in range(n ) : 
	 if(arr[i ] == temp ) : 
	 if(temp == 1 ) : 
	 count += 1 
 temp = k 
  else : 
	 temp -= 1 
   else : 
	 temp = k 
 if(arr[i ] == k ) : 
	 i -= 1 
    return count 
  if __name__== "__main __": 
	 arr =[1 , 2 , 3 , 7 , 9 , 3 , 2 , 1 , 8 , 3 , 2 , 1 ] 
 N = len(arr ) 
 K = 3 
 print(CountSubarray(arr , N , K ) ) 
 
<END_TASK>
