Display Configurations

Ads
 

Display Configurations

The year is 2136. A lot of things have changed but BITS Pilani still exists. The display technology used now is a WASDLED screen.

This display technology consists of a configuration matrix containing a row of N cells each of which can display K different symbols. These K symbols are partitioned into sets X1, X2, ... , Xm

The potency of a configuration matrix is the highest integer i, 1 <= i <= m, such that there is a symbol from Xi in some cell. The configurations with odd potency are invalid whereas those with even potency are valid.

The A3 and A8 students are obsessed with this new display technology. They wonder how many different valid configurations are possible. They turn to you for a solution. Since this number can be very large output this number modulo 1000000007.

Input

A single line containing the integers N and m as described above followed by a line containing m integers: X[1], X[2], ... , X[m] denoting the size (cardinality) of each set. Output

A single line containing the number of valid configurations. Constraints

1 <= N <= 1000000000 1 <= m <= 100000 1 <= X[i] <= 1000 Sample Inputs

Input: 3 2 2 2

Output: 56 Input: 2 3 1 2 3

Output: 8

View Answers

Ads









Related Tutorials/Questions & Answers:
Display Configurations
Display Configurations   The year is 2136. A lot of things have changed but BITS Pilani still exists. The display technology used now is a WASDLED... display technology. They wonder how many different valid configurations are possible
ModuleNotFoundError: No module named 'configurations'
ModuleNotFoundError: No module named 'configurations'  Hi, My... named 'configurations' How to remove the ModuleNotFoundError: No module named 'configurations' error? Thanks   Hi, In your python
Advertisements
ModuleNotFoundError: No module named 'django-configurations'
ModuleNotFoundError: No module named 'django-configurations'  Hi...: No module named 'django-configurations' How to remove the ModuleNotFoundError: No module named 'django-configurations' error? Thanks   Hi
ModuleNotFoundError: No module named 'django_configurations_seddonym'
ModuleNotFoundError: No module named 'django_configurations_seddonym' ...: No module named 'django_configurations_seddonym' How to remove the ModuleNotFoundError: No module named 'django_configurations_seddonym' error
ModuleNotFoundError: No module named 'django-configurations-x'
ModuleNotFoundError: No module named 'django-configurations-x'  Hi...: No module named 'django-configurations-x' How to remove the ModuleNotFoundError: No module named 'django-configurations-x' error? Thanks   
ModuleNotFoundError: No module named 'matialvarezs_node_configurations'
ModuleNotFoundError: No module named 'matialvarezs_node_configurations' ...: ModuleNotFoundError: No module named 'matialvarezs_node_configurations' How to remove the ModuleNotFoundError: No module named 'matialvarezs_node_configurations'
display
display  please tell me how to display the content from database.. if we click on any image using servlets/jsp...please
how to display?
how to display?  How to write a select query for displaying data where i have author as multivalued attribute
how to display?
how to display?  How to write a select query for displaying data where i have author as multivalued attribute
how to display?
how to display?  How to write a select query for displaying data where i have author as multivalued attribute
Display data
Display data  after successful login how i can fetch my account information from sql database
Display Tag
Display Tag  Hi Here is My code, There is problem At line no.3, where i want to display two fields in one column but it gives error.. Please any one knows the solution must reply Thanks In Advance
Display Information
Display Information  I have a listbox having many names and I have a button "display". I select some names and when I click the button , the names along with the address(they are in database) should be displayed. I am using php
image display
image display  sir the answer which you have sent to me is already I have I want to know that the syntax which you have writen for display... to display in image from databse plz help me i will wait for ur reply
Display Tag
Display Tag  Hi Here is My code, There is problem At line no.3, where i want to display two fields in one column but it gives error.. Please any one knows the solution must reply Thanks In Advance
display result
display result  i want a code that takes input from user through dropdown box and display the result into table.all the values regarding the user input must be displayed. i am using mysql database   hi i want study
profile display
profile display  Search page to display matching results in JSP and Servlet   Please visit the following links: http://www.roseindia.net/servlets/search.shtml http://www.roseindia.net/jsp/user-search.shtml
display shapes
display shapes  Hi, I would like to see geometric shapes like square, triangle, circle, rectangle as my outputs. Also, those figures shouldn't overlap while they get displayed. Please help me
image display
image display  sir the answer which you have sent to me is already I have I want to know that the syntax which you have writen for display... to display in "div image from databse /div" plz help me i will wait for ur reply
profile display
profile display  how to display matching Results using jsp-servlet?   Please visit the following links: http://www.roseindia.net/servlets/search.shtml http://www.roseindia.net/jsp/user-search.shtml http
profile display
profile display  how to display matching jobs in jobseeker's profile using jsp-servlets?   Please visit the following links: http://www.roseindia.net/servlets/search.shtml http://www.roseindia.net/jsp/user
Display patterns
Display patterns  Write a test program that read an integer n and call a method to display a pattern as follows: 1 2 1 3 2 1 4 3 2 1 ... n n-1 ... 3 2 1 The method header is public static void displayPattern(int n)   
Display patterns
Display patterns  Write a test program that read an integer n and call a method to display a pattern as follows: 1 2 1 3 2 1 4 3 2 1 ... n n-1 ... 3 2 1 The method header is public static void displayPattern(int n)  
image display
image from access database but Sir I want that how I display image from database
Display image
Display image  How to Pass image from html to jsp and display... the html page to jsp page and display it. 1)page.html: <%@ page language="java" %> <HTML> <HEAD><TITLE>Display file upload form
how to display?
how to display?  I have to write a code for searcing books in library and i have written but it is not displaying the result.I don't know where i have gone wrong.Also i want to know if there is any better idea then this and what
video display in html
video display in html  how to display video file in html
display database results
display database results  how to display database results using php
how to display image with listview
how to display image with listview  How can i display the list view with the related images from database
ModuleNotFoundError: No module named 'display'
ModuleNotFoundError: No module named 'display'  Hi, My Python... 'display' How to remove the ModuleNotFoundError: No module named 'display... to install padas library. You can install display python with following command
display the employee name
display the employee name  when i will select one employee designation based on that employee designation display the particular designation employee name display in another select box how it possible using servlet and mysql

Ads