N, X = gets.split(" ").map{|s| s.to_i} a = [] N.times { a << gets.to_i } a.sort! cnt = 0 a.uniq.each {|y| ymin = a.bsearch_index{|i| i >= y} ymax = a.bsearch_index{|i| i > y} ymax = N if not ymax ycnt = ymax - ymin z = y ^ X zmin = a.bsearch_index{|i| i >= z} next if not zmin zmax = a.bsearch_index{|i| i > z} zmax = N if not zmax zcnt = zmax - zmin cnt += ycnt * zcnt } puts cnt / 2