Simple solution using dynamic programming
Intuition\nPretty simple solution using dynamic programming. Nothing new here\n\n# Approach\nJust keep track of the maximum subsequence at given position which 
# Intuition\nPretty simple solution using dynamic programming. Nothing new here\n\n# Approach\nJust keep track of the maximum subsequence at given position which will have two cases\n\nIncluding the current element or excluding the current element\n\n# Complexity\n- Time complexity:\nO(n*m) where n is the length of the nums array and m is the number of queries\n\n- Space complexity:\nO(n)\n\n# Code\n```\nclass Solution {\n    public int maximumSumSubsequence(int[] nums, int[][] queries) {\n\n        int result = 0;\n\n        for (int[] query: queries) {\n            int pos = query[0];\n            int value = query[1];\n            nums[pos] = value;\n            result = (result + helper(nums)) % 1000000007;\n        }\n        return result;\n    }\n\n    private int helper(int[] nums) {\n        int[] dp = new int[nums.length];\n\n        dp[nums.length-1] = Math.max(nums[nums.length-1], 0);\n        for (int i=nums.length-2; i>=0; i--) {\n            dp[i] = Math.max(dp[i+1], nums[i] + (i+2 <= nums.length-1 ? dp[i+2]: 0));\n        } \n\n        return dp[0];\n    }\n}\n```
['Java']