from heapq import * from itertools import * from functools import * from collections import * import sys,math input = sys.stdin.readline import math N,K = map(int,input().split()) A = list(map(int,input().split())) X = [] for i in range(1<>j)&1: a += A[j] b *= A[j] X += [a,b] X = set(X) print(len(X))