using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class GFG
{
    static public void Main()
    {
        try
        {
            // var n = Console.ReadLine();
            var input1 = Console.ReadLine().Split(' ');
            var n = int.Parse(input1[0]);
            var b = int.Parse(input1[1]);

            var aar = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();

            CardTask(n, b, aar);
        }
        catch (Exception ex)
        {
            Console.Write(ex);
        }
    }

    static void CardTask(int n, int b, int[] arr)
    {

        int[,] dp = new int[n, n];
        long count = 0;
        for (int i = 0; i < n; i++)
        {
            dp[i, i] = arr[i];
            if (arr[i] == b)
                count++;
        }
        for (int l = 2; l < n; l++)
        {
            for (int j = 0; j < n - l + 1; j++)
            {

                int k = j + l-1;

                dp[j, k] = dp[j, k - 1] + arr[k];

                if (dp[j, k] / l == b)
                    count++;
            }
        }
        Console.Write(count);

    }


}