class BIT():



    __slots__ = ["n", "data"]



    def __init__(self, li):

        self.n = len(li) + 1

        self.data = [0] + li

        for i in range(1, self.n):

            if i + (i & -i) < self.n:

                self.data[i + (i & -i)] += self.data[i]



    def add(self, i, a):

        i += 1

        while i < self.n:

            self.data[i] += a

            i += i & -i

        

    def acc(self, i):

        res = 0

        while i > 0:

            res += self.data[i]

            i -= i & -i

        return res

    

    def fold(self, l, r):

        return self.acc(r) - self.acc(l)



import sys

input = sys.stdin.buffer.readline

n, q = list(map(int, input().split()))

A = list(map(int, input().split()))

bit = BIT(A)

for _ in range(q):

    t, p, x = list(map(int, input().split()))

    if t == 0:

        bit.add(p, x)

    else:

        print((bit.fold(p, x)))
class BIT():



    __slots__ = ["n", "data"]



    def __init__(self, li):

        self.n = len(li) + 1

        self.data = [0] + li

        for i in range(1, self.n):

            if i + (i & -i) < self.n:

                self.data[i + (i & -i)] += self.data[i]



    def add(self, i, a):

        i += 1

        while i < self.n:

            self.data[i] += a

            i += i & -i

        

    def acc(self, i):

        res = 0

        while i > 0:

            res += self.data[i]

            i -= i & -i

        return res

    

    def fold(self, l, r):

        res = 0

        while l < r:

            res += self.data[r]

            r -= r & -r

        while r < l:

            res -= self.data[l]

            l -= l & -l

        return res



import sys

input = sys.stdin.buffer.readline

n, q = list(map(int, input().split()))

A = list(map(int, input().split()))

bit = BIT(A)

for _ in range(q):

    t, p, x = list(map(int, input().split()))

    if t == 0:

        bit.add(p, x)

    else:

        print((bit.fold(p, x)))
class BIT:
    __slots__ = ["n", "data"]

    def __init__(self, li):
        self.n = len(li) + 1
        self.data = [0] + li
        for i in range(1, self.n):
            if i + (i & -i) < self.n:
                self.data[i + (i & -i)] += self.data[i]

    def add(self, i, a):
        i += 1
        while i < self.n:
            self.data[i] += a
            i += i & -i

    def acc(self, i):
        res = 0
        while i > 0:
            res += self.data[i]
            i -= i & -i
        return res

    def fold(self, l, r):
        return self.acc(r) - self.acc(l)


import sys

input = sys.stdin.buffer.readline
n, q = list(map(int, input().split()))
A = list(map(int, input().split()))
bit = BIT(A)
for _ in range(q):
    t, p, x = list(map(int, input().split()))
    if t == 0:
        bit.add(p, x)
    else:
        print((bit.fold(p, x)))

class BIT:
    __slots__ = ["n", "data"]

    def __init__(self, li):
        self.n = len(li) + 1
        self.data = [0] + li
        for i in range(1, self.n):
            if i + (i & -i) < self.n:
                self.data[i + (i & -i)] += self.data[i]

    def add(self, i, a):
        i += 1
        while i < self.n:
            self.data[i] += a
            i += i & -i

    def acc(self, i):
        res = 0
        while i > 0:
            res += self.data[i]
            i -= i & -i
        return res

    def fold(self, l, r):
        res = 0
        while l < r:
            res += self.data[r]
            r -= r & -r
        while r < l:
            res -= self.data[l]
            l -= l & -l
        return res


import sys

input = sys.stdin.buffer.readline
n, q = list(map(int, input().split()))
A = list(map(int, input().split()))
bit = BIT(A)
for _ in range(q):
    t, p, x = list(map(int, input().split()))
    if t == 0:
        bit.add(p, x)
    else:
        print((bit.fold(p, x)))

-        return self.acc(r) - self.acc(l) +        res = 0 +        while l < r: +            res += self.data[r] +            r -= r & -r +        while r < l: +            res -= self.data[l] +            l -= l & -l +        return res